Move
New to Analytica 5.0: Move is both a built-in typescript command and a built-in system function. The functionality is the same in both cases, but the built-in function is more convenient from event-handling attributes like OnClick and from User-defined functions. The command would be used from the typescript interface.
SysFunction Move( obj, module )
The first parameter is evaluated and should be a handle to the object to be moved. The second parameter can be either the identifier of the module to move the object into, or an expression that returns a handle to the module to move «obj» into. The function returns a handle to the module that contained the object prior to the move.
This function can be used from event handlers like OnClick and OnChange, or from User-defined functions that are called by event handlers, but because it has a side-effect of moving the object, it cannot be used from a variable Definition.
Examples
Assume Va1
starts in module Mo1
.
This moves all objects in Mo1 into Mo1's parent module:
Command Move «ident» «moduleIdent»
The command version of Move is deprecated, but may still be used from typescript when convenient.
Moves the object «ident» to the module with the indicated identifier «moduleIdent».
- Move ident moduleIdent
From Analytica, you can move objects between modules using drag-drop with the user interface. However, the one place this command is particularly useful is for moving Graph Style Templates. When you define a new graph style template, it is placed in the top-level model, but does not show on the diagram. To move graph style templates to a library, you must enter the typescript window (Ctrl+' ) and use the move command.
The Move command is also the most convenient way to move objects from ADE.
Examples
Suppose you have created a linked module named My_graph_templates
, and you wish to move a recently created graph style template named Psychedelic_Green
to this module, so that the template can be utilized from other models. First, note that you must use the object identifiers in the typescript command, not the object title (if you entered "Psychedelic Green"
, with a space, in the graph style dialog, the object identifier will have an underscore). To move the template, you access the Typescript window by pressing Ctrl+' , and then you type:
Move Psychedelic_green My_graph_template
To verify that the operation has succeeded, you can examine the objects using the Outline window.
History
- Prior to Analytica 5.0, only the command Move existed.
- The function variant of Move was introduced in Analytica 5.0. An attempt is being made to eliminate the need to use typescript commands (i.e., the EvaluateScript function) from event handlers, but making core commands available as functions.
Enable comment auto-refresher