So, I've come up with a way to simulate local variables using macros and defines and would like feedback on this approach from the experts in this forum. (See attached.) I'd like feedback both on the implementation and the usage.
Using this approach, I can write code like below and be assured of having a locally scoped variable "count".
See the attachment for more examples and the implementation.
${LocalVAR} count
Section "one"
strcpy ${count} 1
SectionEnd
${LocalVAREnd} count
${LocalVAR} count
Function one
strcpy ${count} 2
FunctionEnd
${LocalVAREnd} count
So folks, what do you think? Ideally, this would eventually be added to the compiler itself 😉 but for now, this does the trick, for me anyway.
Joe A.