Results 1 to 6 of 6

Thread: GLOBAL VS PUBLIC variables

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    39

    Question GLOBAL VS PUBLIC variables

    i wonder where the difference lies. and can you mention examples where it is more appropriate to use one type over the other???

    thanks in advance!

  2. #2

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: GLOBAL VS PUBLIC variables

    "Public" replaced "Global" as the keyword indicating a project wide declaration.

    I believe Public came into being with VB5 (although it may have been eariler) and Global was using in Vb 4 and previous.

    Global is still available to support backward compatibility.

  4. #4
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: GLOBAL VS PUBLIC variables

    Global was used in VB2/3, Public came in with VB4 16/32bit they both mean the same but get used to using Public.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: GLOBAL VS PUBLIC variables

    Ok....I was close. (I started with VB3 and definately remember Global.)

  6. #6
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: GLOBAL VS PUBLIC variables

    And I started with VB4 16bit and you could use Public in there. I've tried using Public in VB3 but it doesn't like it.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

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