Tip on fixing issues with classes quickly (w/o having to quit Sage Pro)

This is a programmer's tip:
If you are trying to work on a screen in Sage Pro, it is painful to
- Find an issue in the screen- Quit Pro
- then modify the class- then login to Pro
- then load the screen

Here is a way out of the above:
First part of the trick:
- Load VFP in the Pro root folder. Create a program called ClearClass.prg
- In this program give 2 lines to clear the appropriate form class and FS
Examples:
If you are working with sopost
CLEAR CLASS Sopost
CLEAR CLASS cmpSopostFS
If you are working with sycust
CLEAR CLASS SycustMgr
CLEAR CLASS Sycust
CLEAR CLASS cmpSycustFS
If you have created a sub class, use Clear Class with those classes
- Give DO PRO
- Create a custom menu option, by
- Go to SM/System Installation
- Click Edit and goto "Custom" tab
- For menu Text give "CLEAR CLASS"
- For command line give "DO ClearClass.prg"
- If using VFP, click File/Login and login again (for the custom menu to get refreshed)
- If using SQL, Quit Pro and login again (for the custom menu to get refreshed)

Second part of the trick
- Is to load 2 instances of VFP
- In the previous instance you have Pro running.
- Load another instance of VFP and open your class in the class browser.
- Each time you find an issue in the screen you are working with, exit the screen in Pro (but do not quit Pro)
- Click on custom menu "Clear Class"
- In second instance, open the class, do your changes and click "Clean up class library" (to keep the class library file small and running fast)

Now you have the solution to avoid having to quit Pro to make changes to the class you are working with.

No comments: