Show in Frame No Frame
Up Previous Next Title Page Index Contents Search

6.8 Quick reference

A quick reference of MERL commands is provided in the following table:
:property_local_name
Accesses the property with local name property_local_name in the current non-property. To output each line of text separately for text field properties, use a do loop.
.object_type_name
Accesses the instance(s) of the object type called object_ type_name.
>relationship_type_name
Accesses the instance(s) of the relationship type called relationship_type_name.
~role_type_name
Accesses the instance(s) of the role type called role_type_name.
#port_type_name
Accesses the instance(s) of the port type called port_type_name.
()
Substitute for any type reference to allow all types. Parentheses can also include type names with wildcards * separated by |, to allow all matching types.
'string_content'
Fixed literal strings are enclosed in single quotes.
/* comment */
Comments can be placed between /* and */.
$variable_name
Output the value of a global variable named variable_name. Similar to the variable;read clause, but the variable name is statically specified.
@variable_name
Output the value of a local variable named variable_name. Similar to the local;read clause, but the variable name is statically specified.
simple_command%translator_name
Output the value of simple_command with the translation specified by translator_name.
area
Output the area of an element.
bottom
Output the bottom co-ordinate of an element.
centerX
Output the x co-ordinate of the center of an element.
centerY
Output the y co-ordinate of the center of an element.
containers
Use alone or as the argument of a do loop to output the object(s) that contain the current object’s or relationship’s symbol. (Also gives the local name of a property in do :().)
contents
Use alone or as the argument of a do loop to output the objects and relationships contained in the current object’s symbol. (Also gives the content of a property in do :().)
decompositions
Use alone or as the argument of a do loop to navigate to the decomposition graph associated with the current object (i.e. do decompositions { } ).
do type_arg { body }
dowhile type_arg { body }
Navigates to the elements specified in type_arg that are related to the current object, relationship, or role, and runs body for each. Use dowhile to omit the last fixed text elements on the final iteration. To simply iterate over all objects etc. in a graph, use foreach instead.
endreport
End token for the generator definition.
explosions
Use alone or as the argument of a do loop to iterate over the explosion graphs associated with the current object, relationship or role (i.e. do explosions { } ).
external command execute
external command executeBlocking
external command read
Executes an external command defined by command (e.g. as run from the command line). Use executeBlocking to hold the generator execution until the external command has been completed. Use read to get output from commands.
foreach type_arg where condition orderby criteria unique criteria { body }
Iterates over the current graph’s elements specified by type_arg, running body for each. For navigation from a current object, role or relationship, use do or dowhile instead. The looped elements can be constrained by where, orderby and unique keywords. The condition is similar to if condition and criteria is a colon separated list of generator bodies.
filename filename_commands append body close
Append to the file whose name is output by the filename_commands the generator output stream from the commands in body.
filename filename_commands merge ... md5id id_arg md5block body md5sum ... close
Preserves hand-made changes in an output file. The output of id_arg specifies a unique id within the file and the body contains the clauses whose output is preserved. Comment open and close strings can be set using md5start and md5stop before merge.
filename filename_commands print
Exports the diagram of the current graph to the printer or file whose name is output by filename_commands. Filename_commands must be ‘lpt1’ for the printer, or have an extension of .gif, .png, or .pct for graphics files, or .mec or .mxm for model export.
filename filename_commands read
Appends the contents of the file whose name is formed by the output of filename_commands to the current generator output stream.
filename filename_commands write body close
Write to the file, whose name is formed by the output of filename_commands, the generator output stream from the commands in body, overwriting the file if it already exists.
graphs
Use as the argument of a do or dowhile loop to iterate over all graphs.
height
Output the height of an element.
id
Outputs the identifier of the current element.
if condition then then_body else else_body endif
If condition is met, executes the commands in then_body, otherwise executes the commands in else_body. Operators can be =, =~ (wildcard), =/ (regex), <, <=, >, >= or <>. Complex conditions can be formed by using parentheses, NOT, AND, and OR.
internal command execute
internal command read
Runs the command stream as command-line operations in this MetaEdit+. Use read to output the return values from string functions.
math expression evaluate
Evaluates and outputs a mathematical expression.
left
Output the left co-ordinate of an element.
metatype
Outputs the metatype of the current element.
newline
Adds a line break into the output stream.
oid
Output the unique object identifier of the current element, e.g. 13_2342.
orderby commands [, commands]*
Modify the loop to sort the elements by the output of commands
project
Output the project name of the current object.
projectId
Output the project number of the current element.
prompt prompt_arg ask
Prompts for input from user with a dialog showing the output of prompt_arg and appends it to the current output stream.
report 'generator_ name'
Start token for the generator definition, defines also the generator_name (not used in generators associated with text fields in symbols and type identifiers)
right
Output the right co-ordinate of an element.
sep
Output the path name separator character (e.g. ‘\’ in Windows but ‘/’ in Unix).
subreport generator_name_arg run
subreport generator_name_arg runSuper
Executes the generator whose name equals the output of generator_name_arg, with the current stack and generator output. Use runSuper to look up the generator from the super type.
stack
Use alone or as the argument of a do loop to output the current stack contents.
to rules_or_translator_name translate body endto
Replaces strings and characters in the output produced by the body. The rules_or_translator_name specifies the used rules or predefined and named rule(s).
top
Output the top co-ordinate of an element.
type
Output the type name of the current element.
unique commands [, commands]*
Filter the loop to ignore later elements with the same output of commands
variable variable_name_arg write body close
local variable_name_arg write body close
Set the value of variable named variable_name_arg using the generator output stream from the commands in body. Use variable to refer to a global variable and local for local ones.
variable variable_name_arg append body close
local variable_name_arg append body close
Append to the value of variable named variable_name_arg using the generator output stream from the commands in body. Use variable to refer to a global variable and local for local ones.
variable variable_name_arg read
local variable_name_arg read
Output the value of variable named variable_name_arg. Use variable to refer to a global variable and local for local ones.
where condition orderby order_criteria unique unique_criteria
Extra commands that can be added to loops before the block to filter and sort the elements to iterate over. Conditions are as in if statements. Each criterion is a command or sequence of commands; criteria are separated by commas.
width
Output the width of an element.
x
Output the x coordinate of an object or a relationship
y
Output the x coordinate of an object or a relationship


Show in Frame No Frame
Up Previous Next Title Page Index Contents Search