EVAL TEXT: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
{{Command|syntax=EVAL_TEXT <string variable> | {{Command|syntax=EVAL_TEXT <string variable> | ||
|description=: | |description=Evaluate any variables stored in a text variable and save the resulting text back to the variable. | ||
:You need to use this command if you are building up a string variable using the same variable with different values. | |||
|param1=<string variable>|param1_desc={{string variable}} | |param1=<string variable>|param1_desc={{string variable}} | ||
| Line 8: | Line 9: | ||
===Example=== | ===Example=== | ||
:EVAL_TEXT | :i = 1 | ||
:a$ = "i = %i" | |||
:i = 2 | |||
:a$ = a$ + " and now i = %i" | |||
:Message a$ ( this will display the text "i = 2 and now i = 2" | |||
:<br> | |||
:i = 1 | |||
:a$ = "i = %i" | |||
:EVAL_TEXT a$ | |||
:i = 2 | |||
:a$ = a$ + " and now i = %i" | |||
:Message a$ ( this will display the text "i = 1 and now i = 2" | |||
:<br> | |||
:For an example macro see [[Process_Data]] | :For an example macro see [[Process_Data]] | ||
[[Category:Miscellaneous]] | [[Category:Miscellaneous]] | ||
Revision as of 20:43, 18 August 2010
Command
- EVAL_TEXT <string variable>
Evaluate any variables stored in a text variable and save the resulting text back to the variable.
- You need to use this command if you are building up a string variable using the same variable with different values.
Parameters
- <string variable>
- a string variable, for example a$
Example
- i = 1
- a$ = "i = %i"
- i = 2
- a$ = a$ + " and now i = %i"
- Message a$ ( this will display the text "i = 2 and now i = 2"
- i = 1
- a$ = "i = %i"
- EVAL_TEXT a$
- i = 2
- a$ = a$ + " and now i = %i"
- Message a$ ( this will display the text "i = 1 and now i = 2"
- For an example macro see Process_Data