Solved: Using Din in code

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

mrl

Thread Starter
Joined
Aug 12, 2007
Messages
348
Hi
What is the reason to use Din in code? I'm still learning to write macros and can do it easier with out using Din.
When I run it, I can't see a difference

Mike
 
Joined
Jul 29, 2001
Messages
21,334
Are you sure you do not mean Dim? You should always declare your variables.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
If you mean Dim as Rockn suggets it comes from the original BASIC language and was used not only to "declare" variables but also allocate Memory space for them. In those days memory was at a premium, so it was essential for the Basic Editor to have an idea of how much memory to set aside to prevent the program from running out of memory and crashing.
Today it's main use is to tell the VB Editor what Type of variable you are going to use, this has both memory, speed and programming affects.
If you don't declare them the editor will guess what they are and can get them wrong and cause you to get incorrect results (although current VB Editors are pretty good at guessing).
If it is not sure it will assign the variable as a "Variant" which it will then have to change while the program is running, which can be very inefficient.
 

mrl

Thread Starter
Joined
Aug 12, 2007
Messages
348
Hi Rockn,
Opps, yea I mean Dim :D

Hi OBP,
Now I know why the maco sometines run slow and somtimes when I use the recorder, I get the worng results.
Thanks to both of you


Mike :D :D
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top