PDA

View Full Version : Variable placement



Charles Linquis
- 26th July 2011, 21:59
I normally define all my variables at the top of my programs, but I had a guy working for me that defined a bunch of variables about 2/3 of the way through the program. The code was written in such a way that the defines were not executed.

But the code still worked. Does PBP just scan the entire file, look for the keyword 'VAR' and assign memory locations to the variables at that time, regardless of where they are?

Darrel Taylor
- 26th July 2011, 22:21
Yes it does.

However, a variable must be declared BEFORE it is used in the program.