Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making a really good main program.
Message
From
18/04/2001 09:27:27
 
 
To
17/04/2001 17:35:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00496424
Message ID:
00496624
Views:
21
>Thanks for your reply Tom.
>Acording with your recomendation I think some times that is better a object than a program because with a object you only need to change for example the Aplication name, the path; but I`m not able to do it due to I don`t know how.

I think an application object is more flexible, and you should not need to go into any code there, because you would do it as generic as possible.
I have properties like AppName, ShowSplashScreen, NeedSecurity, NeedRegistration which we only need to set in order to let things happen in this object (for example if NeedSecurity = .F., there is no user login etc).
Inside of the application control object I instantiate an application specific object and after all generic stuff is done, it executes AtStartUp(). There the code is which can be changed for each application.

So my main prg looks like so:
LOCAL loSettings
*-- Instantiate the settings class which stores all current
*-- settings to properties in its INIT() and restores
*-- the original settings in its DESTROY() events.
loSettings = NEWOBJECT("StoreSettings", "Utils")
PRIVATE poAppContr
*-- Instantiate the application control.
poAppContr = NEWOBJECT("AppContr", "AppContr")
*-- Run the application. All application specific settings
*-- are set in this class in its properties.
IF poAppContr.RunApp() = .T.
*-- Any failure in RunApp() will not allow to continue.
READ EVENTS
ENDIF

...
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform