• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

Variable and declaration terminology

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 %.

  • 3
  • 2
1 Solution
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
and i just found the rest

they are all type declaration indicators -

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

& is a long.

As in

   dim A as long,

is also
   dim A&


Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

ampapaAuthor Commented:
So, if these are optional as long as I find replace them and properly declare the values correctly I shouldn't have any problems?
exactly, i think they kept them in for the "smooth transition" effect for BASIC to vb users.  

they took them out in vb.net....
ampapaAuthor Commented:
Thanks for the speedy reply's.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now