Difference between revisions of "Move"

m (capitalization of category)
m (slight clarification)
 
Line 3: Line 3:
 
[[Category:Meta-Inference Functions]]
 
[[Category:Meta-Inference Functions]]
  
''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.
+
[[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 ) ==
 
== 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» intoThe function returns a [[handle]] to the module that contained the object prior to the move.
+
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.
  
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]].  
+
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 ===
 
=== Examples ===
Line 24: Line 24:
 
The command version of Move is deprecated, but may still be used from typescript when convenient.
 
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».
+
It moves the object «ident» to the module with the indicated identifier «moduleIdent».
 
   
 
   
 
[[Syntax]]:
 
[[Syntax]]:

Latest revision as of 23:34, 22 June 2022


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.