*EXPA
' Save the variable content of variables to be used as internal variables
' --> The content of the specified variables will be stored in the storage
' region managed by the YVM system
Varpush A&,B&,C&,D#,E#
' The content of the variable stored by Varpush can be changed at will.
GetUnitData 2,"CR",A&
GetUnitData 3,"CR",B&
GetUnitData 4,"CR",C&
4
GetUnitData 5,"X",D#
GetUnitData 6,"Y",E#
' In the case where nesting is used in processing,
' the variables with the same names of A&,B&,C& are used in Subroutine *EXPB.
' however, the variable content will be used in *EXPB Varpush/Varpop
' saving/returning, so there will be no arbitrary rewriting of the variable content.
Gosub *EXPB
Print A&,B&,C&,D#,E#
' The content of variables A&,B&,C&,D#,E# is stored to a different region by
' Varpush which is executed at the beginning of the *EXPA Subroutine
' so there is no danger of the content disappearing before it gets returned.
' Varpush can be executed up to a maximum of 16 times.
Varpop
Return
*EXPB
' The content of variables A&?B&?C&?D#?E# is stored to a different region by
' Varpush which is executed at the beginning of the *EXPA Subroutine
' so there is no danger of the content disappearing before it gets returned.
' Varpush can be executed up to a maximum of 16 times.
Varpush A&,B&,C&,D#,E#
GetUnitData 2,"X",A&
GetUnitData 3,"X",B&
GetUnitData 4,"X",C&
D#=3
E#=100/512
Print A&,B&,C&,D#,E#
Varpop
Return
FZ4 User's Manual
Using Custom Command
295