View Single Post
  #8 (permalink)  
Old 07-02-2008, 11:04 PM
BjornF BjornF is offline
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 143
Default

Dear sberry, like specci48 said, any variable which you would like to use throughout the program and which you want access and change in different subs can be declared as a global variable.

For example, in some programs you might want to keep track of which is the current record in a database, in which case you might use a global variable called e.g. CurrRec. Calling on one sub might move the current record i.e. change the value of the CurrRec), and another sub might use CurrRec to determine which record to show on e.g. a panel. But the central point is that the value of CurrRec is available to all the subs throughout the program.

The global values don't have to have a specific form - you just need to declare them in the "sub Globals"

Björn
Reply With Quote