R�gis Daniel de Oliveira wrote:
you have to declare globals in 2 places usually.How to declare a global variable (I thing i a .h file)
once in a single C file in your project. if you put it in multiple .C files you'll get a compile error that the variable already exists. it's this declaration that actually allocates the memory. do it something like:
int gUserID;
secondly, in the header file that will be included in multiple .C files. Here you don't want to actually allocate space, but rather indicate that this variable has been declared somewhere else and it's memory is already allocated. This you will declare like:
extern int gUserID;
The extern keyword is what indicates that the variable is already declared.
How can I read a Global Variable from a form? How can I set a new value into it?
Then just access it like a normal variable.
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
