VBA Variables

VBA Variables

Anonymous
Not applicable
450 Views
3 Replies
Message 1 of 4

VBA Variables

Anonymous
Not applicable
I'm trying to learn VBA and giving myself quite a headache.
How do you set a number or string as a variable.
In lisp it would be (setq nbr 5) or (setq str "string").
Also in lisp I could check my variable by using ! at the command line. Help says use quick watch but that is not telling me anything. I'm not enjoying VBA so far.
0 Likes
451 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
'As an integer
Dim nbr As Integer
nbr = 6

'As a double-precision floating-point number
Dim nbr As Double
nbr = 6.648

Dim str As String
str = "MyString"

You can also use the Locals window to see all of the variables when you are
stepping through the code.


wrote in message news:5644337@discussion.autodesk.com...
I'm trying to learn VBA and giving myself quite a headache.
How do you set a number or string as a variable.
In lisp it would be (setq nbr 5) or (setq str "string").
Also in lisp I could check my variable by using ! at the command line. Help
says use quick watch but that is not telling me anything. I'm not enjoying
VBA so far.
0 Likes
Message 3 of 4

Anonymous
Not applicable
Hi,

Further to Jeff's post, here's a screen grab illustrating and expanding on
Jeff 's information.

VBA variables are not stored in the AutoCAD environment in the same way as
lisp variables, but are local your application and hence must be reviewed
from within your application.

--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com
.
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thanks for your help
0 Likes