Today I want to tell you my first experiences in converting a FoxPro form into Lianja. I know that the Lianja guys did a fantastic job and I was surprised about the high compatibility, but my decision after this experience is to wait, until most issues are fixed. Our intention is to convert a huge VFP application (440 tables, 1200 forms, 1300 reports, 120 context menus) with minimum effort to exceed the 2 GB database limit. Cross-Platform, Web and Mobile is less important for us. Here are my first experiences:
Database Conversion:
- The conversion itself ran without Errors.
- Problem #1.1: Triggers were removed
- Problem #1.2: Index files are much bigger than in VFP, often they are bigger than the DBF file. Maybe this is because VFP compresses index files and Lianja does not
- Databases with > 2GB are supported, that’s what was promised and I can confirm: it works!
- Problem #1.3: Performance is worse than in VFP. Example: Database with 3.500.000 records, 1.2 GB DBF size, Indexes on all important fields, SET DELETED ON or OFF, No Index on DELETED():
BROWSE FOR itemno=”NotInDatabase” takes about 40 seconds on a SSD drive to show an empty grid. It seems that Rushmore is not implemented as good as in VFP.
Program and Class Conversion:
- Problem #2.1: Lianja cannot work with && comments after a semicolon at the end of a code line
Example:
IF itemno=”4711” OR itemno=”4712”; && Comment
OR itemno=”4713”
? “Test”
ENDIF
- Problem #2.2: Macro substitution does not work in all cases
Example:
lcProc="Proc1()"
RETURN &lcProc. && macro substitution does not work in combination with RETURN
FUNCTION Proc1
WAIT "Proc1" WINDOW
RETURN "ReturnValue"
ENDPROC
- Problem #2.3: Function called with empty parameters causes a compilation error
Example:
loXMLPart = loXML.getPartByTag("Cube",.T.,,2) && compile error “Syntax error”
loXMLPart = loXML.getPartByTag("Cube",.T.,.T.,2) && compiles w/o error
- Problem #2.4: Syntax error during compilation if line is too long (here it was a CASE statement where there were many OR statements in one CASE split with semicolon over about 50 lines of code, like
DO CASE
CASE m.repname="AAAAA" OR;
m.repname="BBBBB" OR;
m.repname="CCCCC" OR; …….
ENDCASE
- Problem #2.4: TYPE("_SCREEN.ActiveForm") returns "L" instead of "U", when it’s not an object. It also seems that _SCREEN.ActiveForm is not fully implemented in Lianja.
- Problem #2.5: VERSION(4) is currently not implemented ("invalid parameter")
- Problem #2.6: SET ENGINEBEAVIOR 70 not implemented. Console Window says that the command should be SET ENGINEBEHAVIOR TO 70, but this is not supported yet.
- Problem #2.7: SET TABLEVALIDATE is currently not implemented (not a problem for us)
- Problem #2.8: SET SYSFORMATS ON is currently not implemented (big problem for us!)
- Problem #2.9: SET COLLATE TO is currently not implemented (not a problem for us)
- Problem #2.10: Classes olecontrol and oleboundcontrol not implemented
- Problem #2.11: Umlauts (e.g. ö,ä,ü,Ö,Ä,Ü,ß) are causing problems if used e.g. in label-names (this is a big issue for us, because we use a lot of umlauts in label names)
- Problem #2.12: MESSAGEBOX command executed in a Activate event of a converted VFP form cause to fire the Activate of the form again, after the messagebox is closed. Same problems appear when working in the debugger. SET STEP ON causes the forms deactivate Event to fire. It’s hard to debug the Activate Event of a scp file. I think that VFP had the same problem.
- Problem #2.13: The following statement in the Activate Event of a converted form caused Lianja to hang:
IF !THISFORM.InLoad
Could it be, that THISFORM cannot be used in the Activate Event?
- Problem #2.14: Events (my biggest problem and the reason for me, to stop the evaluation):
My problem in my converted sample form was, that Refresh fired first, then Activate fired but Init and Load never fired. I was able to close the form and Deactivate fired, but I got no chance to let Init and Load fire. After hours of spending time, I gave up.
I have a PRG file with this lines:
set classlib to controls
set procedure to appproc
open database testdatabase
use testable order testindex
do form testform
In my converted testform, I create procedures for all events to see if they fire or not.
Example:
PROCEDURE Load
=STRTOFILE("Testform Load Begin"+CHR(13)+CHR(10),"c:\log\log.txt",1)
DODEFAULT()
=STRTOFILE("Testform Load End"+CHR(13)+CHR(10),"c:\log\log.txt",1)
ENDPROC
The only code that is executed is Refresh, Activate and Deactivate – Load and Init never fires.
In my converted scp file, the last lines are like this:
=STRTOFILE("Testform before CreateObject"+CHR(13)+CHR(10),"c:\log\log.txt",1)
frmtestform_rni0rpnh1 = createobject("frmtestform")
=STRTOFILE("Testform before Show"+CHR(13)+CHR(10),"c:\log\log.txt",1)
frmtestform_rni0rpnh1.show(1)
The show command is never been executed!! The CreateObject causes Refresh and Acitivate to fire and the form is shown on the screen, but it seems, that the CreateObject stops at some point and this causes Linja to not execute Init and Load and after that the frmtestform_rni0rpnh1.show(1) line.
Problem #2.14: Load fires after Init. I tested this in a Linja page. This is a big problem for us, because in VFP, Load fires before Init and all of our forms are based on this knowledge.
Importer problems:
- Problem #3.1: In generated Interface Methods, ENDPROC is not inserted. This will cause the beautify-feature to indent code more and more.
Example:
** Interface-Methods
Procedure SampleProcedure
endproc && this line is not inserted by the import routine
- Problem #3.2: Importer has problems when a line ends with “;” or ‘;’
Example:
IF 1=1
result=STR(teststring,3,0)+”;”
ENDIF
After conversion, it looks like this:
IF 1=1
result=STR(teststring,3,0)+” ” ENDIF
The “;” changed to “ “ and CR/LF is missed before ENDIF
- Problem #3.3: I had some problems with Arrays written with [] instead of () – but I’m currently not able to reproduce this and can give you no example
- Problem #3.4: My converted classlib-File (controls.vcp) had to be re-arranged first, because it’s not possible to subclass before the parent class was defined. This is a minor issue, it took some hours to fix it but it must done only once. It did it step-by-step by invoking the SET CLASSLIB TO controls in the command window, seeing which line caused the error and then moved the class code before the first subclass statement.
- Problem #3.4: Double Quotation Marks after conversion (instead of using " and ')
Original statements:
builderx = HOME()+"Wizards\BuilderD,BuilderDForm"
THISFORM.txtField1.Inputmask=REPLICATE("X",22)
Converted statement:
builderx = "HOME()+"Wizards\BuilderD,BuilderDForm""
THISFORM.txtField1.Inputmask="REPLICATE("X",22) "
General Lianja Problems:
- The Editor is slow in loading big files (in my example a class-library with >20.000 lines)
- The Editor is extremely slow in modifying big files (even moving the cursor up and down without changing anything is very slow, if you are in the mid or at the end of the file)
- IntelliSense is hardly missed (Editor AND Console Window). I know it’s scheduled for release 2.0, but the earlier we have this feature, the better. We can no more live with IntelliSense!
- I’m hardly missing the “compile” feature after closing an editor window
- Small Bug: Enter SET COMPATIBLE plus hit ENTER in the console window will cause Lianja to hang
Best Regards,
Uwe Bader - Spaichingen/Germany
Bookmarks