|
-
Oct 20th, 2005, 09:56 AM
#1
Thread Starter
Junior Member
[RESOLVED] Global Variables
I am having trouble acessing Variables that I am declaring in the Module. When I try to use these variables that I declared in the Module [module code](Dim strname as string) I try to use them like [procedure code](txtname.text=strname) they come up as not delcared.
If anyone can help as to how to use global variables it would be greatly appreciated.
-
Oct 20th, 2005, 10:03 AM
#2
Fanatic Member
Re: Global Variables
Are they in the same module? If yes, make sure that they come after the Public Class declaration and are not declared inside of another routine. Also, when you make a module-level variable, most folks use Private instead of Dim. If no, try below.
Try replacing Dim with Public
Public strName as String
-
Oct 20th, 2005, 10:04 AM
#3
Re: Global Variables
Well, if you are using the simple Dim statement to define them, they aren't publicly available (they're private by default). If you use Public instead of Dim, then you should be OK.
-tg
-
Oct 20th, 2005, 10:39 AM
#4
Thread Starter
Junior Member
Re: Global Variables
Thanks guys!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|