Object Manipulation Typescript Commands
«className» «ident»
Typing the name of an object class followed by a new identifier creates a new object of the indicated type. The object is placed into the current module. The current module can be set prior to declaring a new object using Open m . A list of possible class names can be obtained by typing list object.
When the object is created, it becomes the current object. Attributes set without an explicit object identifier apply to this object.
Examples
Create a chance variable:
> Chance Adjusted_weight
> Title : Adjusted Weight
> Units : Lbs
> Definition: Normal(155, 15)
Create a variable inside the module Expense Details:
> Open Expense_details
> Variable Water_pmts
> Definition: 15
> Close Expense_details
«attribute» [«ident»] : «value»
Sets the value of an attribute of an object. The object «ident» is optional. When omitted, the attribute of the current object is set. The current object is usually the object most recently recreated, or selected using the With command.
The keyword Of before «ident» is optional.
As a typescript command, the «value» is literal text. It does not have to be quoted when textual, and it is not evaluated. This is in contract with an assignment expression, in which the right-hand side does get evaluated. If you want the assignment operator, surround the expression with parentheses, which will cause the typescript interpreter to interpret it as an expression, rather than as a typescript command.
Examples
> Index J
> Definition: 1..5
> Title Revenue: Annual Revenue
> With Drate
> Title: Discount rate
Delete
- Delete [all] ident
Deletes the object with the indicated identifier.
If the object is a module, there are two possible behaviors:
- Objects contained within the model are moved to the parent, so that only the module object is deleted but not the objects inside it.
- Everything within the module is also deleted.
The second behavior occurs when you specify all
(it also accepts the keywords recursive
or every
), or when the object being delete has no parent (i.e., is the top-level model).
Rename
- Rename oldIdent newIndent
Renames the identifier of an object from «oldIdent» to «newIndent».
Move
- Move o m
Moves object «o» from its current module into module «m». More details can be found at Move.
Open
- Open m
Makes «m» the current module, so that any new objects created from typescript are placed into this module.
There is another form of the Open command that can be used for opening windows. See Open in User Interface Typescript Commands for details.
Close
- Close m
The parameter, «m», must be the current module. If so, then sets the current module to be the parent of the current module. When new objects are created from typescript, they are placed into the current module.
When «m» is the top-level module or model object, this closes the model and exits Analytica.
There is another form of the Close command that can be used for closing windows within Analytica. See Close in User Interface Typescript Commands for details.
Edit
- Edit ident
Jumps to the appropriate user window where the definition of the indicated variable can be edited.
With
- With
Prints the current module
- With m
When «m» is a module, sets «m» to be the current module. Same as Open m.
- With v
Sets «v» to be the current variable. If you type the name of an attribute (only) into typescript, it'll print the attribute value for the selected variable. If you type «attribute» : «value»
, it will set the attribute for the selected variable.
Enable comment auto-refresher