PUBLIC oGlobal Set Classlib to <ClassLibLocation> oGlobal = CreateObject("GlobalApp") oGlobal.Addproperty("UserColorSet,"") && early in program... ... ... oGlobal.UserColorset=RGB(0,0,255) && somewhere later in programThis way, all variables can be well-documented and they automaticallu go Bye-bye when the global App does...
>* Declare GLOBAL variables. Notice that I use the g here for PRIVATE variables. >* The g indicates that these variables are visible/global to the entire application. >* The only place where private variables are allowed to start with a g is in the main program. >* This usage of g is different from what's proposed in the vfp-documentation (where it's >* advised for public variables). >private goMainWindow, goNewActivity, goReports, goOptions > >* References to forms. >store null to goMainWindow, goNewActivity, goReports, goOptions > >do form MainWindow name goMainWindow > >read events > >release all like g* >* The ALL LIKE wouldn't work for public variables. >* However, it's not even a necessary statement, for these variables >* will go out of scope anyway on return. > >RETURN >>Feedback please.