Rewrite a backoffice developed in Microsoft FoxPro

235 views
Skip to first unread message

Umberto Meglio

unread,
Sep 30, 2021, 9:42:00 AM9/30/21
to The Ring Programming Language

I develop in Visual FOXPRO for about 25 years and in these years I wrote a warehouse management (350 forms 200 reports 100 modules 40 classes (300K line code).

To date,  I enriched it with a Web look  through the server "Fox page server 2.1" by Arquimedes Crivelari , but I realize that it is not enough. I need to rewrite everything in a modern, simple, fast and effective language and Ring seems to be best choice.

For DB i investigate MonetDB, but know  also other commercial SQL RDBMS :-). 

For reporting tools i investigate FastReport, but know also Crystal report and other. 

I await your welcome reply and opinion for choise of DB system and  reporting Tools.

Thanks

Mansour Ayouni

unread,
Sep 30, 2021, 12:53:17 PM9/30/21
to Umberto Meglio, The Ring Programming Language
Hello Umberto,

Congratulations for option to Ring in modernizing your codebase.

In your case, I think, these are the main parts of Ring that you should look for:
  • The FoxRing library lets you using your FP functions inside Ring. 
  • The RingQt library for designing your forms and for many other features you will need (text processing, dates and number formatting, unicode, and many others). It also allows you to publish your desktop app on a web browser (via WebAssembly) or design mobile version from the same code.
  • The native functions to support a professional database system like Postgress or MySQL or any other engine using ODBC. 
  • The file management functions provided natively by Ring and file and data transfert functions provided by other extensions (like LibCurl for example) for sending data from your app to external (offline or online) tools like Crystal Reports.
  • The WebLib library for writing your app and deploying it to the web.
  • The Ring2EXE tool if you ever need to distribute part of your software as a GUI application on many platforms.
Link: https://ring-lang.sourceforge.io/doc1.15/distribute_ring2exe.html
  • The official Ring IDE (NotePad) or any one of other supported code editors.

Besides, you'll need to reflect on the best possible software architecture to optimize your time and effort while porting sutch a large project.

My advice is to divide it on to small functional modules, and deliver them progressively to your end users, while trying to make this change as smooth as possible.

Good luck and feel free to come back to us for any help.

Best,
Mansour Ayouni
Author of the "Beginning Ring" Book with Apress


Sipos S.r.l.    

Via F. Imparato, 198 80146 Napoli 

Centro Napoli Est - Isola F4

T +39 081 559 1558 

www.sipos.it




Prima di stampare questa e-mail assicurarsi che sia davvero necessario.

Nota: Le informazioni contenute in questo messaggio possono contenere dati personali (sensibili o ordinari) o essere coperte dal segrto professionale e riservate; quindi ai fini del rispetto delle Legge 196/2003 sulla tutela dei dati personali tali informazioni non sono divulgabili. Se la persona che ha ricevuto questo messaggio non e il destinatario diretto oppure e un impiegato o incaricato responsabile di recapitare il messaggio a tale destinatario, e informato che qualsivoglia rilascio, comunicazione, distribuzione e/o copia non espressamente autorizzata e proibita dal mittente. Se, per errore, avete ricevuto questa comunicazione vogliate cortesemente comunicarcelo immediatamente tramite Risposta al messaggio e cancellarla dal vostro computer. E' da rilevare inoltre che l'attuale infrastruttura tecnologica non può garantire l’autenticità del mittente, ne' tanto- meno l'integrita' dei contenuti.

----

"DISCLAIMER: Confidentiality Notice - This e-mail message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message".


--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/db90bd4e-82c4-4fd5-8437-e85dc7dd20dcn%40googlegroups.com.

Umberto Meglio

unread,
Oct 1, 2021, 3:58:09 AM10/1/21
to The Ring Programming Language
Hi Mansour, thanks for the quick response. 

With Visual FoxPro I'm used to having a form management in MDI mode. Is it possible to design the forms in this way? MDI_Form.jpg


Furthermore, with regard to the reporting system, is there an integrated system? With the Notepad IDE I can easily design complex forms whit many object.
In this example many field are calculated and other are binding with data.

Complex_form.jpg

Thanks always for your kind reply

Mansour Ayouni

unread,
Oct 1, 2021, 5:51:04 AM10/1/21
to Umberto Meglio, The Ring Programming Language
Hello Umberto,

Yes, you can benefit from the same development experience of MDI windows in Ring, well, using the declarative style of RingQt.

Here I show you how to do it. The code is self-explanatory and commented so you can understand every step. Also I provide you with the result as done on my desktop.

Of course, you'll need to dedicate some time to learn all the features you need in RingQt, but this is a rewarding investment. When done right, then you can go relatively quickie in porting your codebase.

Here is the code, and a copy of it attached, along with the snapshot:

# Inviting the RingQt library

load "guilib.ring"


# Creating an QApp object to hold your holle app

oApp = new QApp {


/* Creating a main workspace for your app, where you wan design the GUI structure of your App (menu, toolbar, dockbars, status bar)... And more importantly, for your case, a central region where you can specify your MDI windows... */


oMainWin = new QMainWindow() {

# There are many options available for describing your main window, but we set just the title for conciseness

setWindowTitle("MultiStore Solution from Sipos")


# Now, we design the MDI area of our workspace

mdiArea = new QMDIArea(oMainWin) {


# Inside it, we put any number of MDI subwindows

# let's make two of them...


# First MDI window

mdiSubWin1 = new QMDISubWindow(mdiArea) {

setWindowTitle("I'm MDI 1")

# Inside our first MDI subwindow, we can put any widget we need like (texts, buttons, lists, images...)


# For the sake of simplicity, we'll add just a button

btn = new QPushButton(mdiSubWin1) {

setText("Hi, I'm a button in MDI1")

}


# Than we tell to the sub window that it should

# consider our button as a widget inside it

setWidget(btn)

}


# Second MDI window: same logic!

mdiSubWin2 = new QMDISubWindow(mdiArea) {

setWindowTitle("I'm MDI 2")

btn = new QPushButton(mdiSubWin2) {

setText("Hi, I'm a button in MDI2")

}


setWidget(btn)

}

}


# Great, we've finished designing the MDI area of our workspace! Let's tell to our QMainWindow to populate its central region with it

setCentralWidget(mdiArea)


# Now, our design is ready, let's tell to RingQt to display it on screen as soon as the App is executed

show()

}


# Finally, we execute the app

exec()

}


Happy Ringling!

Best,
Mansour

ringqt-mdi-win.PNG
ringqt_designing_mdi_windows.ring

Mahmoud Fayed

unread,
Oct 1, 2021, 11:59:39 AM10/1/21
to The Ring Programming Language
Hello Mansour

>> "Yes, you can benefit from the same development experience of MDI windows in Ring, well, using the declarative style of RingQt."

Thanks for sharing the sample :D


Keep up the GREAT WORK :D

Greetings,
Mahmoud

Mansour Ayouni

unread,
Oct 1, 2021, 12:04:26 PM10/1/21
to Mahmoud Fayed, The Ring Programming Language
Hi Mahmoud,
You're welcome! And thanks for including the sample :)
Best,
Mansour

Umberto Meglio

unread,
Oct 1, 2021, 12:47:35 PM10/1/21
to The Ring Programming Language
Hi Mansour,

In foxpro it is possible to manage a "data session" for the parent-child forms, that is to transfer local variables and data cursors between the forms or decide that each form has a private set of variables and data. 

In the Ring / Qt environment is this session management implementation possible? 

 I hope I was clear.

Mansour Ayouni

unread,
Oct 2, 2021, 10:39:32 AM10/2/21
to Umberto Meglio, The Ring Programming Language
Hello Umberto,

Yes.

You can either do it in pure Ring or with the more sophisticated RingQt data mechanism.

In Ring, you can design your data transfer startegy basically like this:
  • A global object that maintains the state of the window with all the necessary data,
  • This object is called from every window to update the table of data
  • If the data is changed in a window, then the global widow is updated
  • In each window, if the user wants to update the data then a click of button car read the global object and update the table
Or by relying on an MVC architecture where every table is automatically updated when the date changes in an other window.

Or by letting one window updating directly the other, which is possible, but leads to complex code.

Whate ever solution you opt for, you minimally need to learn:
Otherwise, you can use the sophisticated Qt way of binding data to graphic widgets, which is powerful and provides you with a similar programming experience as what you had in FoxPro. But this:
Good luck,
Mansour

Mansour Ayouni

unread,
Oct 2, 2021, 10:44:05 AM10/2/21
to Umberto Meglio, The Ring Programming Language
Soory,

Please consider this link about including new classes to RingQt and not the one in the previous post:

In fact, this is a tool that automatically generates all the integration staff of any Qt class in RingQt.

Best,
Mansour
Reply all
Reply to author
Forward
0 new messages