Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Pdox 5.0 (Win 3.1) to Pdox 11 for WinXP

Status
Not open for further replies.

MandyW

Programmer
Oct 12, 2005
4
US
For my condo, over the last 10 years I have developed a large Property Management application (400+ tables, 500K+ lines of ObjectPal code, 100+ forms) running with Pdox 5.0/Win 3.1 and extensively using the Woll2Woll ezDialogs/ezDoc add-on programs.

Although Woll2Woll no longer sells/supports ezDialogs/ezDocs, I have a 32-bit version of ezDialogs that seems to work okay with Win98SE. However, there doesn't appear to be a 32-bit version of ezDOC, which I relied on to do global searches of all ObjectPal code for references to tables, fields, etc. (Without a global-search tool, I would consider the system unmaintainable.)

I'm trying to decide whether it makes sense to upgrade to Pdox 11 or rewrite for a whole new platform (e.g. php/mySql).

I assume that upgrade will require substantial manual effort to modify code to deal with the lack of supported ezDialogs/ezDoc as well as the normal incompatibilities from version to version of any software product. (Without ezDoc, just the task of manually delivering 300+ libraries and forms will be a colossal pita.)

Can anybody recommend any tools, white papers, etc. that would facilitate such a conversion and/or offer strategic advice based on real-world experience?

Thanks for any help you can offer.
 
The below code will open each type of object (form,report,library), then save, then deliver. You'll get an error when tables can't be found. You can select a new or write down the form/report and cancel; the script will continue from that point.

Kinda ugly, with ALL CAPS and all. But it works, so I've just never gone back to modify.

Be sure to adjust the ":ALIAS:" stuff as appropriate.

Code:
; add passwords for any tables the forms/reports might be based on



ADDPASSWORD("TONY McGUIRE")
ADDPASSWORD("YNOT McGUIRE")

FILVAR.ENUMFILELIST(":ALIAS:*.LSL",":ALIAS:LIBR_C.DB")

TABVAR.ATTACH(":ALIAS:LIBR_C.DB")
SORT TABVAR
ON "NAME"
ENDSORT
TABVAR.UNATTACH()
SLEEP()


TCUVAR.OPEN(":ALIAS:LIBR_C.DB")
FOR I FROM 1 TO NRECORDS(":ALIAS:LIBR_C.DB")
TCUVAR.MOVETORECORD(I)
CURVAR=":ALIAS:"+TCUVAR.NAME
IF libVAR.LOAD(CURVAR) THEN
sleep(200)
libVAR.SAVE()
sleep(200)
libVAR.DELIVER()
sleep(200)
libVAR.CLOSE()
sleep(200)
ENDIF
ENDFOR
TCUVAR.CLOSE()
SLEEP()



FILVAR.ENUMFILELIST(":ALIAS:*.FSL",":ALIAS:form_C.DB")

TABVAR.ATTACH(":ALIAS:form_C.DB")
SORT TABVAR
ON "NAME"
ENDSORT
TABVAR.UNATTACH()
SLEEP()


TCUVAR.OPEN(":ALIAS:form_C.DB")
FOR I FROM 1 TO NRECORDS(":ALIAS:form_C.DB")
TCUVAR.MOVETORECORD(I)
CURVAR=":ALIAS:"+TCUVAR.NAME
SLEEP()

IF forvar.LOAD(CURVAR) THEN
sleep(200)
forvar.SAVE()
sleep(200)
forvar.DELIVER()
sleep(200)
forvar.CLOSE()
sleep(200)
ENDIF
ENDFOR
TCUVAR.CLOSE()
SLEEP()



FILVAR.ENUMFILELIST(":ALIAS:*.RSL",":ALIAS:report_C.DB")

TABVAR.ATTACH(":ALIAS:report_C.DB")
SORT TABVAR
ON "NAME"
ENDSORT
TABVAR.UNATTACH()
SLEEP()


TCUVAR.OPEN(":ALIAS:report_C.DB")
FOR I FROM 1 TO NRECORDS(":ALIAS:report_C.DB")
TCUVAR.MOVETORECORD(I)
CURVAR=":ALIAS:"+TCUVAR.NAME
SLEEP()

IF repvar.LOAD(CURVAR) THEN
sleep(200)
repvar.SAVE()
sleep(200)
repvar.DELIVER()
sleep(200)
repvar.CLOSE()
sleep(200)
ENDIF
ENDFOR
TCUVAR.CLOSE()
SLEEP()

MSGINFO("DONE","DONE")

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Tony...

Thanks for a very practical suggestion for one of the major clerical tasks associated with converting from Pdox 5.0 to Pdox 11+. This should make it much easier for me to do some more ad-hoc testing and try to get a better feel as to how much of the ObjectPal code may have to be tweaked in order to run correctly.

Just a couple of questions on code details:

[1] Why are you saving the Source code forms/libraries, et al? I assume that save() will upgrade them to the Pdox version in which they were saved, thus making them no longer backward compatible with Pdox 5.0. Personally, I'd rather keep the Source programs in Pdox-5-compatible format until conversion was complete. Do you see any problem with that?

[2] Why are there so many sleep() statements embedded in the code? Is this to give you time to view any error messages from delivery?

Again, thanks for the tip.

.....mandy
 
I'm saving because this script is *intended* to create a new version, *not* worry about both versions accessing, so I didn't have to wonder whether it was the source version of p5 format that was causing some issue or another.

Make a backup! so you have a version for p5, if that is a concern. You'd be crazy not to.

The sleeps are in there just cause. I find that sprinkling them in where load/save/deliver are concerned makes more sense than leaving them out. Gives everyone a little more breathing room.

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top