Varpush

Temporarily saves the value of a variable.

Varpush <Variable Name 1>[,<Variable Name 2>[,...,<Variable Name N>]]) 

Parameters
<Variable Name>
The name (variable name) of the variable to be saved.

Return Value
None.

Description
The value of the variable specified by <Variable Name N> is saved temporarily.
By combining the saving and returning of a variable, it is possible to use the interim variable as an internal variable.The creative efficiency and maintainability of a large program can be enhanced through the use of internal variables.
If the variables fit within a row (255 characters), as many as desired can be saved at one time.
Saved variable values are stored in a hierarchy of up to 16 levels.The levels are increased by 1 each time saving is carried out and reduced by 1 each time a return is done.Saving to the 17th hierarchical level will result in an "Internal error".
Only integer and double-precision variables can be saved.Character string and mixed character string variables cannot be specified.
Executing the New command and the Load command will clear all of the saved variable values.

Example
Declare an array.
*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&
    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 the saved variable is returned
    '  --> When Varpop is executed, the variable content saved by the nearby Varpush will be returned.
    

    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