>>I am working with an application that use global variables, i.e. public variables defined in the main program. I would like to replace them with equivalent application specific properties, i.e. properties that can be used anywhere in the application. Values for the properties would come from a table.
>>
>>Several examples.
>>1, Name of current user, security level, etc.
>>2. headings for reports, forms, etc.
>>
>>Questions
>>1. Is it possible?
>>2. If so how? Please supply sample code snippets.
>
>I suspect I'm missing something obvious. If you want to continue to use your global variables, then you'd simply
>
>USE yourSettingsTable
>STORE TheReleventFields TO TheReleventPublicVariables
>
>Do I misunderstand your question?
Claude,
To go a little further with what Nancy said, any variable initialized in the Main program is seen throughout the application by default, and it need not be specified as "global."
Some developers use an Application Object (oApp) which holds all the "variables" as properties. You could initialize the oApp in the Main program and when the user identifies himself, pick up the properties and assign them to oApp.
In the login form you'd have something like
SELECT UserTable
LOCATE FOR UserTable.UserID = frmLogin.txtUserID.VALUE
IF UserTable.Password <> frmLogin.txtPassword.VALUE
ENDIF
oApp.CurrentUser = UserTable.UserID