Modules

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Variable Definitions and Operations > MOD. - Modules >

Modules

MOD.Copy from Last

Previous Top Next


MiniRobotLanguage (MRL)

 

MOD.Copy from Last

Copy variables together with their type and content from the last module to this module

 

 

 

Intention

You can use this command to copy one or multiple variables from the module where you have been before to this module where you are now.

All the variables are copied together with their type and content, they will stay in the module where they were before and they will exist as a copy in this module where you are now.

If there is a variable with this name already in this Module-Space, that Variable will be deleted.

 

Note that MOD.Copy from last is a lot slower than MOD.Move from last.

As MOD.Move from last will move the complete variable like a rename operation while MOD.Copy from last will indeed Create a new Variable with the complete data in this module space.

You can use MOD.Move from Last to move a Variable into a new Module-Space and at the end of the Module just Move it out again using MOD.Move to Last .

The same is also available as MOD.Copy from Last to copy the Variable back, overwriting whatever was there before.

 

 

 

Syntax

 

 

MOD.Copy from Last|P1

 

 

Parameter Explanation

 

P1 - List with Variables that shall be copied to the current Module. There is no hard coded limitation on the number of Variables in that list.
        MOD.Copy from Last|$$VAA,$$VAB,$$VAC

 

 

 

 

 

Example

 

'***********************************

' MOD.Copy from Last-Sample

'***********************************

$$VAA=Its a A:

$$VAB=Its a B:

PRT.With $$VAA$crlf$$$VAB

MOD.New|Left

MOD.Main

GSB.Subr

GSB.Test

PRT.With $$VAA$crlf$$$VAB

MBX.!

ENR.

'-----------------------------------------------------------

:Subr

MOD.Enter|Left

MOD.Copy from Last|$$VAA,$$VAB

$$VAA=$$VAA as expected

GSB.Test

PRT.With $$VAA$crlf$$$VAB

MOD.Return

RET.

'-----------------------------------------------------------

:Test

MOD.Get Last Name|$$THI

PRT.We came from: $$THI

MOD.Get Name|$$CUR

PRT.We are here: $$CUR

RET.

 

 

clip0977

This is the Output from the Script above.

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: