Variable and declaration terminology

Posted on 2004-11-01
Last Modified: 2010-05-02
Can someone explain to me what the ampersand represents in this declaration: ByVal sigNode& as well as the dollar sign and percent for variables: szEntity$, ret %.

Question by:ampapa
    LVL 8

    Expert Comment

    got this from Q_20343884

    The "$" is a carryover from the original BASIC to indicate that a variable or function was a string-type.  In VB, this was retained and later made optional, although the string-type operates slightly faster than the version without the string (which uses a variant.)

    If you attempt to use a "$" after a non-string variable, you may get an error.

    These are identical in VB6:

    Dim A$
    Dim A as string
    LVL 8

    Accepted Solution

    and i just found the rest

    they are all type declaration indicators -

    ($) - string
    (!) - single
    (&) - long
    (%) - integer
    (#) - double
    (@) - currency

    LVL 16

    Expert Comment

    & is a long.

    As in

       dim A as long,

    is also
       dim A&


    LVL 8

    Author Comment

    So, if these are optional as long as I find replace them and properly declare the values correctly I shouldn't have any problems?
    LVL 8

    Expert Comment

    exactly, i think they kept them in for the "smooth transition" effect for BASIC to vb users.  

    they took them out in
    LVL 8

    Author Comment

    Thanks for the speedy reply's.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Course: JavaScript Coding - Massive 12-Part Bundle

    Regardless of your programming skill level, you'll go from basics to advanced concepts in a vast array of JavaScript subjects including Sammy.js, Agility.js, Ember.js, Node.js, jQuery, AJAX, Extjs, AngularJS, Knockout.js, and JSON.

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    877 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now