Archive: Variables


Variables
Hi,

I understand that we have 20 variables to play around with?

I was just wondering if my below code uses any of these variables and if it does, which does it use?

!definevar1""

Thanks.:)

No, it doesn't :)


Defines are being processed on compile time. For example, when you add

!define TEMPVAR "$R0"

${TEMPVAR} will be replaced by $R0 when compiling.

If you want to use variables temporary, use Push/Pop:

Push $R0

...using $R0 as temp var...

Pop $R0


If you have to ask wether your code uses one of those 20 variables, you propably don't know what variables we're taking about. In paragraph 3.3.1 of the documentation (here), you can find those variables, ranging from $0 to $9 and $R0 to $R9. You don't have to declare/define the variables, so you don't have to use '!define'. You can, however, use 'StrCpy', found in the documentation here.

If you want to use one of those 20 variables 'twice', use Joost Verburg's code above.

You might already know this, then ignore my post.