What is the meaning of Dim

Hi all,

Dim in VBA is a key word used to define variable. But
what does it stand for? For example

Dim varCopy As Long

Thanks,

Li

chen li wrote:

Hi all,

Dim in VBA is a key word used to define variable. But
what does it stand for? For example

Dim varCopy As Long

“In some dialects, variables must be declared (using the DIM statement)
on
their first usage; …”

Basically, in VBA, “dim” causes a variable to be declared and associated
with a predefined data type or class.

Some advice from an experienced programmer. Avoid too much immersion in
VBA.
Microsoft is notorious for serial abandonment of its proprietary
user-level
languages in its effort to get you to move on to their latest fad, all
in
the name of continued corporate profitability.

Paul L. wrote:

Basically, in VBA, “dim” causes a variable to be declared and associated
with a predefined data type or class.

In Ruby def is a breviation for the word define and what is the full
name for dim in VBA? I want to know it just out of curiocity. I don’t
pay much attention to VBA but when I use WIN32OLE for Excel automation I
would like to know a little more.

Thanks,

Li

On 14-Dec-06, at 4:09 AM, Li Chen wrote:

Paul L. wrote:

Basically, in VBA, “dim” causes a variable to be declared and
associated
with a predefined data type or class.

In Ruby def is a breviation for the word define and what is the full
name for dim in VBA? I want to know it just out of curiocity. I don’t
pay much attention to VBA but when I use WIN32OLE for Excel
automation I
would like to know a little more.

My vague memories of Basic (not Visual Basic) include using DIM to
dimension arrays - see Wikipedia, the free encyclopedia
Dartmouth_BASIC#List_of_statements

I don’t know when it changed into a general declaration lead-in.

Mike

Mike S. [email protected]
http://www.stok.ca/~mike/

The “`Stok’ disclaimers” apply.

Li Chen wrote:

Paul L. wrote:

Basically, in VBA, “dim” causes a variable to be declared and associated
with a predefined data type or class.

In Ruby def is a breviation for the word define and what is the full
name for dim in VBA? I want to know it just out of curiocity. I don’t
pay much attention to VBA but when I use WIN32OLE for Excel automation I
would like to know a little more.

It was originally an abbreviation for “dimension”, a term that was only
approximately related to its actual function. Think of “dimension” as a
verb and you will get some idea what the originators had in mind.

Also, it is important to add that “dimension” was originally meant to
create
an array that might have more than one “dimension”.

http://sip.clarku.edu/tutorials/True_BASIC.html

“Arrays are defined in a DIM statement and the total number of elements
of
an array is given in parentheses.”

Li Chen wrote:

Thanks,

Li

DIMension – from the original Dartmouth BASIC, which descended from
FORTRAN, where DIMENSION is spelled out.

HTH.


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

Thank you all for the explanations,

Li

chen li wrote:

Dim in VBA is a key word used to define variable. But
what does it stand for? For example

Dim varCopy As Long

VB was actually created as a joke programming language by a college
student. He used ‘Dim’ for variable definition as a tongue-in-cheek
insult to those foolish enough to stumble across and end up using his
little project. Ironically, Microsoft ended up picking up the fledgling
language as their script of choice for business app customization, much
to the delight of the language’s originator–for what could make better
comedy than throngs of business professionals typing Dim all day long,
secure in the thought that they were using a productive programming
language. Just the thought of it still makes me twitter with glee.

Tom

That story is untrue, and I believe meant as a joke. :slight_smile:

At least I hope so, because the proper explanation is that Dim means
“dimension” as others mentioned before.

–Jeremy

Dimension derives from the CDE (Common, Dimension, Equivalence) group of
array declarations for Fortran I. The reference is the IBM Fortran I
Manual, or McCracken.

On 12/14/06, Tom W. [email protected] wrote:

insult to those foolish enough to stumble across and end up using his
little project. Ironically, Microsoft ended up picking up the fledgling
language as their script of choice for business app customization, much
to the delight of the language’s originator–for what could make better
comedy than throngs of business professionals typing Dim all day long,
secure in the thought that they were using a productive programming
language. Just the thought of it still makes me twitter with glee.

Tom

Do you have any proof of this? I can’t find such a story anywhere (after
googling for about 5 minutes, of course. Yay work!)

Jason

Curiously, I’ve been programming steadily since 1962-3. That’s over
fifty years now, whew? My first machine was a Bendix G-15, the next was
an IBM 1620. That was in high school. Google the machines, they were
historically interesting. The G-15 had 2000 words of magnetic drum
memory and a vacuum tube arithmetic unit. Only assembly language,
intercom 500 or intercom 1000, double precision need apply. The 1620 was
a decimal machine, very unusual. Programmed in Fortran I, or COBOL.

Bill

I’m sure the conversation from 2006 appreciates the comment!

I find it easier to use “declare in memory” as a way for newbies (like
me) to remember “Dim”.