2024-02-25 11:53 AM - last edited on 2024-09-26 01:14 PM by Doreena Deng
I created a simple Macro, where I needed to define different variables which should be passed to the Caller. This works fine with the following Script:
! Macro
butter = "Apple"
END butter
! Caller
CALL "var_define" PARAMETERS RETURNED_PARAMETERS butter
TEXT2 0, 0, butter
But I need to write different other scripts as well in the macro (UI, 2D, Parameter, etc.)
For this reason I have to define a "MASTEREND" in the Master-Script, because otherwise the other scripts would not be executed, because of the "END" in the Master-Script.
But now the following script does not work: the variable "butter" and its value is not passed to the Caller.
! Macro
butter = "Apple"
GOTO "Masterend"
END butter
"Masterend":
! Caller
CALL "var_define" PARAMETERS RETURNED_PARAMETERS butter
TEXT2 0, 0, butter
Any ideas to solve this problem?
2024-02-27 12:50 PM
Hi,
the end statements need to be duplicated in each script which wants to return a value.
! Macro master
butter = "Apple"
! Macro 2D
! no code
END butter
! Macro 3D
! lots of code
END butter
! Macro UI
! no code, return value not used in caller - leave empty
2024-02-27 05:17 PM
Thank You Peter, I will test it.