...

View Full Version : VBS --> defining the variable every single time



velious
05-05-2004, 06:29 AM
in this line from one of my scripts:

dim ask, a, b, c, b1, b2, r, answer, user

I defined every variable i was useing. Can i leave out all that and just write something like this without the "dim" and the long line of variables?

x = "sgdfgd"
msgbox (x)

shmoove
05-05-2004, 08:20 AM
If you have "Option Explicit" in the beginning of the script then you have to Dim your variables, otherwise you don't. But it is good practice to always use "Option Explicit" and Dim all the variables, because it can prevent bugs (like reusing a variable name by mistake).

shmoove



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum