Initializing global public variables

Discussion in 'Beta Versions' started by corwin42, Aug 27, 2008.

  1. corwin42

    corwin42 Expert Licensed User

    If I try to initialize global variables which are declared as public on the same line as the declaration I get very strange error message.

    Code:
    Sub Globals
     
    Public someVariable = 1
    End Sub
    gives error

    Code:
    Sub Globals
     
    Public someVariable
     someVariable = 
    1
    End Sub
    is fine

    Greetings,
    Markus
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The first syntax is not supported.
    It wasn't supported in previous versions as well:
    Code:
    Dim x = 34 'ERROR
    The second case is fine and the variable will be public.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice