Results 1 to 5 of 5
  1. #1
    Cecil is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2011
    Location
    Dallas, Texas
    Posts
    11

    Either &0, or 0&

    In Visual FoxPro we use the & (Ampersand_ symbol to designate a variable as being a macro expansion, so that if a variable represents a command, for example, using something like &RunThis, the placement of that variable will actually run the command it represents.

    So, my question is, what does &0 or 0& represent? I can't remember which came first, the 0 or the ampersand. I saw it in some VBA code a few days ago and was curious what its purpose is.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    It is a "type-declaration character" and in this case it types it as a Long Integer.

  3. #3
    Cecil is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2011
    Location
    Dallas, Texas
    Posts
    11
    So, is it declared as 0& or &0?
    Quote Originally Posted by RuralGuy View Post
    It is a "type-declaration character" and in this case it types it as a Long Integer.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    I believe it is a trailing declaration. I use Dim Statements so I'm not real familiar with this method. I also use Option Explicit so the compiler will catch my mistakes.

  5. #5
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    I use Ampersand Hex all the time when defining static objects for tcp ip packets in vb+.

    Like
    Packet.InsertBye(&HFF)
    Check in Immediate
    ?&HFF
    returns 255

    Ive never really used it as ?&123

    & But itself like 0&0 will concatenate the two values. See immediate window ?0&0

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums