Data types

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Since Access 2003 i've had great difficulty finding anything in Help.
Searching for "Declare Variables" yields the Microsoft privacy statements. Go
figure.
I have some old code that uses $, %, @, etc in DIM statements, For example
DIM MyString$ instead of DIM MyString as String. I cannot find a guide to
these data type conventions. Can someone help please.
 
Wow, Richard, those type declaration characters are form the steam-engine
days of BASIC. It's very hard to get any documentation on them now.

I think this is the complete list:
% Integer (short)
& Long
! Single
# Double
@ Currency
$ String

While I never use these for variable names, I do find them very handy for
specifying the type of literals. If you code:
Debug.Print 200 * 200
you get an overflow error, so it make sense to code:
Debug.Print 200& * 200&
 
I started out programming in CBasic and still find these shorthand names
useful. "Real" programmers, however, are appalled when they see them in my
code. Thanks...Richard
 
Back
Top