Question How to write a main method in Progress 4GL?

senthil4ru

New Member
Hi,
I know am asking a stupid question, sorry for inconvenience. I am a newbie to OOPS in Progress 4GL. I wrote a simple class with 2 methods in it and saved it as .cls file. I hope we can't run CLASS files, correct me if am wrong. If it can be run, unlike JAVA main method what is the equivalent in Progress 4GL? Where does Progress 4GL start execution in case of CLASS (i mean kind of main method in JAVA)?

Regards,
Senthil
 

TomBascom

Curmudgeon
Your startup procedure must be an ordinary .p. That procedure can then invoke classes at will. If you want to launch it at the command line you use something like:

mpro dbname -p startMeUp.p
 

tamhas

ProgressTalk.com Sponsor
ABL does not currently support beginning a session with a .cls. As Tom says, you must use a .p as the startup and launch the class from there. Code in the constructor is run with a new, but I strongly encourage you to limit that to actions necessary to have a valid instance and, in particular, to avoid anything which might fail, since that would leave you without the class you thought you had just newed. Instead, use an Initialize() method to do the start up stuff.

Some functional equivalent of main() has been discussed on the roadmap. See http://www.oehive.org/OOWishList
 
Top