Evaluate Macro parameter before macro execution?
Posted: Sun Jan 31, 2016 9:00 pm
				
				I'm trying to figure out how to feed a variable to a macro and use it to assemble it into another variable name inside the macro. The ting is , I would like call the macro inside a loop like below but the parameter used in the concantenated variable name in the macro is the literal value of the variable not its content even if it would seem that it should work? Is there any way to do this?
results in
			Code: Select all
Macro TestD(number)
  Debug "Macro input parameter:" + number
  Debug "Variable value :" + Str(i#number)
EndMacro
i1=2
i2=4
i3=6
; Works
TestD(1)
TestD(2)
TestD(3)
; Does not work
For i=1 To 3
  Testd(i)
Next
Code: Select all
[20:55:59] Waiting for executable to start...
[20:55:59] Executable type: Windows - x86  (32bit, Thread)
[20:55:59] Executable started.
[20:55:59] [Debug] Macro input parameter:1
[20:55:59] [Debug] Variable value :2
[20:55:59] [Debug] Macro input parameter:2
[20:55:59] [Debug] Variable value :4
[20:55:59] [Debug] Macro input parameter:3
[20:55:59] [Debug] Variable value :6
[20:55:59] [Debug] Macro input parameter:1
[20:55:59] [Debug] Variable value :0
[20:55:59] [Debug] Macro input parameter:2
[20:55:59] [Debug] Variable value :0
[20:55:59] [Debug] Macro input parameter:3
[20:55:59] [Debug] Variable value :0
[20:55:59] The Program execution has finished.