Results 1 to 4 of 4

Thread: Noob easy question about scope

  1. #1

    Thread Starter
    Fanatic Member scr0p's Avatar
    Join Date
    Oct 2002
    Location
    VA
    Posts
    720

    Noob easy question about scope

    I am just starting to use modules, anyway, I want my product's name to be in a constant, so I can easily change it later on, can I declare it in a module? If I put like "Public const THE_PRODUCT_NAME = "WordPadX v1.0" then I try to use it in a form, it says (variable not definied).

    also what is the difference between global and public?
    asdf

  2. #2
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    global and public are the same thing, just named differently

    I think Global is the 'new' way to name them.

    I just tried what you posted and it worked for me.

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    either:

    a) you mispelled it
    or
    b) you ae using a class module isntead of a .bas module
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4

    Thread Starter
    Fanatic Member scr0p's Avatar
    Join Date
    Oct 2002
    Location
    VA
    Posts
    720
    Ok I had the const's declared under all the functions, I moved them up to right under option explicit, It works now.
    asdf

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