Move


Move is a built-in system function that moves a selected object (which could be a module) into another module. It has side effects, so may only be called from event-handling attributes like OnClick or a User-defined functions called from an event.

SysFunction Move( obj, module )

The first parameter «obj» is a handle to the object to be moved into «m», which is a handle to or identifier of a module. It returns a handle to the module that contained the object prior to the move.

You can use this function from event handlers like OnClick and OnChange attributes, or from User-defined functions that are called by event handlers. Because it has the side-effect of moving the object, you can't call it from a variable Definition.

Examples

Assume Va1 starts in module Mo1.

Move( Handle(Va1), Mo2 ) → Handle(Mo1)
Move( Handle(Va1), Handle(Mo1)) → Handle(Mo2)

This moves all objects in Mo1 into Mo1's parent module:

Move( Contains Of Mo1, IsIn of Mo1 )

Command Move «ident» «moduleIdent»

The command version of Move is deprecated, but may still be used from typescript when convenient.

It moves the object «ident» to the module with the indicated identifier «moduleIdent».

Syntax:

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.

See Also

Comments


You are not allowed to post comments.