By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,098 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,098 IT Pros & Developers. It's quick & easy.

Dim X as long ==> What is the value of X???

P: n/a
MLH
What is the value of X immediately after
declaring the variable? I thought its value
was Null. However, I am unable to assign
a value of Null to X...

X = Null produces an error. I don't understand.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"MLH" <CR**@NorthState.net> wrote
What is the value of X immediately after
declaring the variable? I thought its value
was Null. However, I am unable to assign
a value of Null to X...

X = Null produces an error. I don't understand.


Long is a primitive type. It has no Null value, like a Variant would, and
you can never assign Null to it.

BTW, why would you want to? If it is numerical data you are working with,
why do you want to assign a value that has no numerical equivalent? Assign
it the value 0.
Darryl Kerkeslager


Nov 13 '05 #2

P: n/a
MLH
<snip>
Thx, Darryl, for the info. What I wanted to do was clear the value of
the variable. It makes perfect sense to set it to zero. That will work
for me. I just erroneously assumed that the way to clear a variable's
value was to set it equal to Null. Of course, that's incorrect.

Regards,
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx

Long is a primitive type. It has no Null value, like a Variant would, and
you can never assign Null to it.

BTW, why would you want to? If it is numerical data you are working with,
why do you want to assign a value that has no numerical equivalent? Assign
it the value 0.
Darryl Kerkeslager


Nov 13 '05 #3

P: n/a
> What I wanted to do was clear thevalue of the variable.
Dim X as long sets it to zero.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.