Page 1 of 1
Minor variable bug
Posted: Fri Sep 02, 2005 3:13 am
by zchris
Run this code:
Code: Select all
Set Variable AA to V1
Set Variable BB to V2
MessageBox Test, $AA$BB$AA$ - $BB$AA$BB$
The result is "V1BBV1 - $BBV1BB$" instead of "V1BBV1 - V2AAV2".
Posted: Fri Sep 02, 2005 4:58 am
by sinan
I'm not sure I see what the problem is? If you would like all variables to be dereferenced, you need to include more dollar signs, like so:
Please let me know if I am misunderstanding anything.
Posted: Mon Sep 05, 2005 2:37 am
by zchris
The problem is that in $BB$AA$BB$ it is dereferencing the variable $AA$ even though I did not specify the variable - I only specified the string AA.
So for $BB$AA$BB$ I would expect it to only replace the two variables $BB$ resulting in V2AAV2.
Posted: Mon Sep 05, 2005 4:05 am
by sinan
I see what you mean. That is interesting. Variables are substituted in order of their declaration. So indeed, the parser notices $AA$, and substitutes that first, before even getting to $BB$.
Does that help you with the problem?
Posted: Tue Sep 06, 2005 3:25 am
by zchris
I thought this was a bug because the installer produced a different result than I expected. If you say this is by design then that's OK with me.
Thanks.
Posted: Tue Sep 06, 2005 6:17 am
by sinan
Yes, this is by design
