Results 1 to 4 of 4

Thread: EASY EASY EASY quesation, just woundering!!!

  1. #1

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    What does this mean, I see it at the top of code windows and I just woundered what it is there for. Every one probably knows this but I don't cause it isn't mentioned I any books on VB.

    Code:
    Option Explicit
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    It means that using an undeclared variable will result in an error. Try this code:
    Code:
    For a = 1 To 100
    Next
    A is not declared, so if you add option explicit it will not run.

  3. #3
    Lively Member
    Join Date
    Feb 2000
    Posts
    118

    use it

    if you do not use Option Explicit the following will be two different variables.
    [CODE]
    Private Sub Command1_Click()
    For abc = 1 To 100
    Next abc
    Text1.Text = acb
    End Sub
    So if you spell something wrong, VB will make it a new variable.
    Kokopeli
    VB6 SP3

  4. #4

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    I get it now, its about the same as what I thought. Thanx
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width