Making an array Public

Cableguy

Expert
Licensed User
Longtime User
Hi

My question is simple, but I just can't find the answer...

I need to make an arry public so that I can use it from another module...

I've tried a few variations on the declaration but no result but error...
 
I did not tryed that as the lack of the dim keywor meake the array not to be created...
I got a workaround working...:sign0161:... I added an ArrayList Control, and as controls are always public, I can now access it...

But the question is still valid...
 
Hi Paulo,
You can declare the array in the Sub Globals of any module like:
Code:
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Globals[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]'Declare the global variables here.[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] TextG([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]30[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT][/SIZE][/FONT]

In the same module where the array is declared you can use the array like TextG(12).
Outsides the module you must use ModuleName.TextG(12)

Best regards.​
 
Last edited:
Hi klaus

I did try that and it didn't work....Have you actually tryed it?
 
Thanks Klaus and Andrew, I trust you findings...But as i posted before, I managed to workaround in a somewhat more pratical way using the AddArrayList keyword.
 
Back
Top