|
-
Mar 4th, 2002, 05:19 AM
#1
Thread Starter
Addicted Member
Variable updation...
Hi everybody,
I created a variable in a module and tried to assign it a value in the module itself. But it gives some error. My question is, is it not possible to assign a value to a varaiable in the module? Also do i need to assign the value in a procedure.
Please help.
Thanx.
Regards
Samir.
-
Mar 4th, 2002, 05:21 AM
#2
Retired VBF Adm1nistrator
You can assign in a value from anywhere.
You're obviously ****ing up the code somehow...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Mar 4th, 2002, 05:25 AM
#3
Bouncy Member
what error does it give???
-
Mar 4th, 2002, 05:29 AM
#4
Frenzied Member
You have to assign it a value from within a procedure of some sort, you can't do this:
VB Code:
Option Explicit
Dim strVariable as String
strVariable="Hello world" 'can't do this
Private Sub DoSomething()
strVariable="Hello world" 'can do this
End sub
-
Mar 4th, 2002, 05:36 AM
#5
Thread Starter
Addicted Member
Hi darre1
It gives me the compile error "Invalid outside procedure"
when I try to run it
Global gvar As Integer
gvar = 10
The code above is what i wrote in the module......
-
Mar 4th, 2002, 05:39 AM
#6
Thread Starter
Addicted Member
Thanx everybody
Thanx everybody for your valuable information.
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
|