Important Question Process Global Variables

drj

Member
Licensed User
Longtime User
Hi,

I have defined three modules - one main ,one for display and one for code.

In the main I define all my memory resident data in the Process Global section and I initialize this data.

As I understand it , that global data is available to all modules including my code module.

Just to test this I created a small sub in my code module that used some of the variables defined in my Main routine in the Process Global section of the Main module.

When I tried to compile the code I got errors in the code modules that these variables are undeclared.

I thought that once I defined and declared a variable in Process Global then that variable would be available to all my modules.

What am I doing wrong?

Thanks Jerry
 

klaus

Expert
Licensed User
Longtime User
How do you call these variables in the code module ?

Main module
Dim MyVariable as String ' in Process_Globals

MyModule.Variable

Code module module name 'MyModule'
Dim Variable as String ' in Process_Globals

Main.MyVariable

To call a variable in another module than the module where the variable was dimed it must have this module name as a prefix.

Look at chapter 10.5.1 Process variables in the Beginner's Guide.

Best regards.
 
Upvote 0

drj

Member
Licensed User
Longtime User
Ok my bad

Ok, My Bad I thought that since it was totally Global then I did not have to do that.

Then here is a question.

In what module should one define the Process Global data in - if I want to have a database common to all routines would I be better in defining the database in a code module rather than Main or any Activity Module?

Thanks Jerry
 
Upvote 0
Top