|
-
Oct 6th, 2000, 08:02 PM
#1
What does 'Option Explicit' do anyway?
-
Oct 6th, 2000, 08:07 PM
#2
Lively Member
Variable
It makes it so you have to declare a variable to be able to use it...
-
Oct 6th, 2000, 08:09 PM
#3
VB's definition:
[/quote]
Used at module level to force explicit declaration of all variables in that module.
Syntax
Option Explicit
Remarks
If used, the Option Explicit statement must appear in a module before any statements that declare variables or define constants.
If you don't use the Option Explicit statement, all undeclared variables are of Variant type unless the default type is otherwise specified with a Deftype statement.
When you use the Option Explicit statement, you must explicitly declare all variables using the Dim, Private, Public, ReDim, or Static statements. If you attempt to use an undeclared variable name, an error occurs at compile time.
Tip Use Option Explicit to avoid incorrectly typing the name of an existing variable or to avoid risking confusion in code where the scope of the variable is not clear.
[/quote]
-
Oct 6th, 2000, 08:11 PM
#4
Fanatic Member
And if i catch anyone not using Option Explicit i will personally come round to your house and slap you around till you swear on your life that you will always use it from that day on
Iain, thats with an i by the way!
-
Oct 6th, 2000, 09:36 PM
#5
Not using Option Explicit is actually SOMETIMES helpful, for if you kept on forgetting to dim something, OE can give you a hard time.
Hey, why is Option Explicit so Popular? Why not Option Compare or Option Base?
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
|