"Global" Qualifier question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lyn

    "Global" Qualifier question

    Hi and Season's Greetings to all.

    I have a question regarding the use of a qualifier word "Global". I cannot
    find any reference to this in Access help, nor in books or on the Internet.
    "Global" seems to be recognised by Access in at least three cases:-

    1) "Global Const". Recently someone in this group helped me resolve a
    problem, and it involved the use of a Global Const. By Googling "Global
    Const", I got plenty of hits -- but they were mostly just snippets of code
    using this type of statement. Is there any difference between "Global
    Const" and "Public Const"? If so, what is it?

    2) "Global" variable. In an experiment, I found that I could replace "Dim"
    (or "Public" or "Private") with "Global" in a variable declaration and it
    would be accepted by Access VBA. Example -- instead of "Public x As
    Integer" I typed "Global x As Integer". Again, is there any difference
    between "Public" and "Global" in the variables context?

    3) "Global Sub/Function". In another experiment, I entered into a module:
    "Global Sub xxx()" and pressed ENTER. The compiler accepted this, but
    automatically deleted "Global", leaving just "Sub xxx()". However, if I
    replaced "Global" with some arbitrary "word" (eg: "Qaz Sub xxx()"), I got a
    compiler error. So it seems that the compiler accepts "Global Sub" but
    treats it like a "Public Sub" (which just "Sub" defaults to).

    So my question is: what is it with "Global"? My guess would be that it is
    an obsolescent form that is still supported for backwards compatibility.
    This could explain why it is not documented anywhere that I could find. If
    so, is it fully equivalent with "Public". If not, what exactly does
    "Global" mean, and where can I find any documentation?

    I am sure the gurus out there will know the answer to this!

    --
    Cheers,
    Lyn.


  • Matthias Klaey

    #2
    Re: "Global&qu ot; Qualifier question

    On Fri, 24 Dec 2004 15:40:30 +1100, "Lyn" <lhancock@ihug. com.au>
    wrote:
    [color=blue]
    >Hi and Season's Greetings to all.
    >[/color]
    [...][color=blue]
    >
    >So my question is: what is it with "Global"? My guess would be that it is
    >an obsolescent form that is still supported for backwards compatibility.
    >This could explain why it is not documented anywhere that I could find. If
    >so, is it fully equivalent with "Public". If not, what exactly does
    >"Global" mean, and where can I find any documentation?
    >[/color]

    "Global" is indeed an obsolete keyword stemming from Access 2.0 and
    earlier. You can replace any occurrence of "Global" with "Public"; the
    two keywords mean exactly the same.

    HTH
    Matthias Kläy
    --
    Internet, Telefonie, TV, Webhosting, Cloud, E-Mail, Backup & Business Connectivity

    Comment

    • Lyn

      #3
      Re: &quot;Global&qu ot; Qualifier question

      Thanks Matthias. You have confirmed my suspicions.

      --
      Cheers,
      Lyn.

      "Matthias Klaey" <mpky@hotmail.c om> wrote in message
      news:hgans0ht4n og153cj6kujusi7 7i95isd3g@4ax.c om...[color=blue]
      > On Fri, 24 Dec 2004 15:40:30 +1100, "Lyn" <lhancock@ihug. com.au>
      > wrote:
      >[color=green]
      >>Hi and Season's Greetings to all.
      >>[/color]
      > [...][color=green]
      >>
      >>So my question is: what is it with "Global"? My guess would be that it is
      >>an obsolescent form that is still supported for backwards compatibility.
      >>This could explain why it is not documented anywhere that I could find.
      >>If
      >>so, is it fully equivalent with "Public". If not, what exactly does
      >>"Global" mean, and where can I find any documentation?
      >>[/color]
      >
      > "Global" is indeed an obsolete keyword stemming from Access 2.0 and
      > earlier. You can replace any occurrence of "Global" with "Public"; the
      > two keywords mean exactly the same.
      >
      > HTH
      > Matthias Kläy
      > --
      > www.kcc.ch[/color]


      Comment

      • Sherwood Wang

        #4
        Re: &quot;Global&qu ot; Qualifier question


        "Lyn" <lhancock@ihug. com.au> wrote in message
        news:cqg6k3$1db $1@lust.ihug.co .nz...[color=blue]
        > Hi and Season's Greetings to all.
        >
        > I have a question regarding the use of a qualifier word "Global". I
        > cannot find any reference to this in Access help, nor in books or on the
        > Internet. "Global" seems to be recognised by Access in at least three
        > cases:-
        >
        > 1) "Global Const". Recently someone in this group helped me resolve a
        > problem, and it involved the use of a Global Const. By Googling "Global
        > Const", I got plenty of hits -- but they were mostly just snippets of code
        > using this type of statement. Is there any difference between "Global
        > Const" and "Public Const"? If so, what is it?
        >
        > 2) "Global" variable. In an experiment, I found that I could replace
        > "Dim" (or "Public" or "Private") with "Global" in a variable declaration
        > and it would be accepted by Access VBA. Example -- instead of "Public x
        > As Integer" I typed "Global x As Integer". Again, is there any difference
        > between "Public" and "Global" in the variables context?
        >
        > 3) "Global Sub/Function". In another experiment, I entered into a module:
        > "Global Sub xxx()" and pressed ENTER. The compiler accepted this, but
        > automatically deleted "Global", leaving just "Sub xxx()". However, if I
        > replaced "Global" with some arbitrary "word" (eg: "Qaz Sub xxx()"), I got
        > a compiler error. So it seems that the compiler accepts "Global Sub" but
        > treats it like a "Public Sub" (which just "Sub" defaults to).
        >
        > So my question is: what is it with "Global"? My guess would be that it is
        > an obsolescent form that is still supported for backwards compatibility.
        > This could explain why it is not documented anywhere that I could find.
        > If so, is it fully equivalent with "Public". If not, what exactly does
        > "Global" mean, and where can I find any documentation?
        >
        > I am sure the gurus out there will know the answer to this!
        >
        > --
        > Cheers,
        > Lyn.
        >[/color]

        global is globe like. public is just public. no documentation needed yes?

        ***Sherwood Wang MVP***



        Comment

        • Lyn

          #5
          Re: &quot;Global&qu ot; Qualifier question

          I'm sorry, I didn't understand your comment. I know what "global" means in
          English, and in computer-speak it usually means something like "valid
          everywhere". But then isn't that also what "public" means in the VBA
          context? Hence Matthias' comment that both mean the same thing.

          I wasn't using Access in its early version, so I am assuming from Matthias'
          comment that "Public" has replaced "Global", or perhaps that the two terms
          were so close in function that they were merged, possibly to avoid confusion
          (like mine :-).

          --
          Cheers,
          Lyn.

          "Sherwood Wang" <shwang@waynesw orld.net> wrote in message
          news:1103873112 .a49a4b10d0f142 d9086e9db99e296 6fb@teranews...[color=blue]
          >
          > "Lyn" <lhancock@ihug. com.au> wrote in message
          > news:cqg6k3$1db $1@lust.ihug.co .nz...[color=green]
          >> Hi and Season's Greetings to all.
          >>
          >> I have a question regarding the use of a qualifier word "Global". I
          >> cannot find any reference to this in Access help, nor in books or on the
          >> Internet. "Global" seems to be recognised by Access in at least three
          >> cases:-
          >>
          >> 1) "Global Const". Recently someone in this group helped me resolve a
          >> problem, and it involved the use of a Global Const. By Googling "Global
          >> Const", I got plenty of hits -- but they were mostly just snippets of
          >> code using this type of statement. Is there any difference between
          >> "Global Const" and "Public Const"? If so, what is it?
          >>
          >> 2) "Global" variable. In an experiment, I found that I could replace
          >> "Dim" (or "Public" or "Private") with "Global" in a variable declaration
          >> and it would be accepted by Access VBA. Example -- instead of "Public x
          >> As Integer" I typed "Global x As Integer". Again, is there any
          >> difference between "Public" and "Global" in the variables context?
          >>
          >> 3) "Global Sub/Function". In another experiment, I entered into a
          >> module:
          >> "Global Sub xxx()" and pressed ENTER. The compiler accepted this, but
          >> automatically deleted "Global", leaving just "Sub xxx()". However, if I
          >> replaced "Global" with some arbitrary "word" (eg: "Qaz Sub xxx()"), I got
          >> a compiler error. So it seems that the compiler accepts "Global Sub" but
          >> treats it like a "Public Sub" (which just "Sub" defaults to).
          >>
          >> So my question is: what is it with "Global"? My guess would be that it
          >> is an obsolescent form that is still supported for backwards
          >> compatibility. This could explain why it is not documented anywhere that
          >> I could find. If so, is it fully equivalent with "Public". If not, what
          >> exactly does "Global" mean, and where can I find any documentation?
          >>
          >> I am sure the gurus out there will know the answer to this!
          >>
          >> --
          >> Cheers,
          >> Lyn.
          >>[/color]
          >
          > global is globe like. public is just public. no documentation needed
          > yes?
          >
          > ***Sherwood Wang MVP***
          >
          >
          >[/color]


          Comment

          • Bas Cost Budde

            #6
            Re: &quot;Global&qu ot; Qualifier question

            Lyn, Sherwood Wang is known for trolling.

            --
            Bas Cost Budde, Holland

            I prefer human mail above automated so in my address
            replace the queue with a tea

            Comment

            • Lyn

              #7
              Re: &quot;Global&qu ot; Qualifier question

              Fair enough!

              --
              Cheers,
              Lyn.

              "Bas Cost Budde" <b.costbudde@he uvelqop.nl> wrote in message
              news:cqgu99$jo9 $1@news2.solcon .nl...[color=blue]
              > Lyn, Sherwood Wang is known for trolling.
              >
              > --
              > Bas Cost Budde, Holland
              > http://www.heuveltop.nl/BasCB/msac_index.html
              > I prefer human mail above automated so in my address
              > replace the queue with a tea[/color]


              Comment

              • Steve Jorgensen

                #8
                Re: &quot;Global&qu ot; Qualifier question

                On Fri, 24 Dec 2004 12:39:03 +0100, Bas Cost Budde <b.costbudde@he uvelqop.nl>
                wrote:
                [color=blue]
                >Lyn, Sherwood Wang is known for trolling.[/color]

                Actually, a sock puppet under the name of Sherwood Wang.

                Comment

                Working...