BOOLEAN var initially FALSE?

R

Rick Charnes

Just to confirm: when I first declare a boolean var --

DIM myvar AS BOOLEAN

myvar has an initial value of FALSE without my doing anything, right?
 
C

Chad DeMeyer

Correct.
Although, I've heard that it's bad programming practice not to explicitly
initialize variables.
But I've been known to neglect that step.

Regards,
Chad
 
J

Jay Freedman

Rick said:
Just to confirm: when I first declare a boolean var --

DIM myvar AS BOOLEAN

myvar has an initial value of FALSE without my doing anything, right?

Hi Rick,

Yes, that's correct. However, it costs very little to assign it explicitly
at the beginning of the macro, and could be helpful to a human reader trying
to understand the code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top