You can use the following commands in a schema:
- :output filename
- Sends output to filename. Any existing data in the
file is lost.
- :extend filename
- Appends output to filename. Creates the file if it
does not already exist.
- :close
- Closes an output file opened by a previous :output
or :extend. This command is never required, since
Libero does an implicit :close before any
:output or :extend, and at the end of the
schema. If you use :close when no file is open you'll
get a warning message.
- :copy fromfile tofile
- Copies one file to another. The tofile is silently
overwritten if it already exists.
- :rename fromfile tofile
- Renames one file to another. The tofile may not
already exist.
- :delete filename
- Deletes filename without any error if the file does
not exist.
- :include [optional] filename [from
[to]]
- Includes filename in the generated output code. If
you specify from, Libero searches the file for a line
containing this text by itself, and starts copying from that
point on. If you specify to, Libero ends copying when it
finds a line containing just this text. You can put quotes
around from and to if these contain embedded spaces. If you
use the optional keyword, Libero ignores the :include
command if it can't find the specified file. The included file
can be anywhere on the path value.
- :echo text
- Echoes text to the standard output, followed by a
newline. If the text is enclosed in quotes, leading spaces are
not discarded.
- :declare [int | string] [$]name
[=expression]
- Defines a variable for later use in the schema. Except for
those that Libero supplies as standard, you have to declare any
variables that you want to use. You can specify the variable
name with or without a '$' in the name.
Variables are
either integers, strings, or variants (either type depending on
mood). You cannot assign a string expression to an integer.
Otherwise Libero is pretty relaxed about how you mix variable
types. The expression provides a default initial value for the
variable. If you do not provide an initial value, strings are
empty and numbers are zero. You can override any initial value
using an -option on the command-line or in the dialog.
Use: -opt:var="string" or
opt:var=expression.
The name of a variable cannot be
int or string. Variable names are
case-independent; :declare $drink and :declare
$DRINK refer to the same variable. If you declare an
existing variable, you'll get an error message.
- :set [$]name = expression
- Assigns a new value to the variable specified. You can use
a '$' before the variable name if you want to. You cannot set a
read-only variable.
- :push [$]variable [=expression]
- Creates a new instance of the variable. If you give an
expression the new variable gets this value. The variable must
then be a read-write variable. You can push a read-only
variable but not specify an expression. This may sound
pointless, but can be useful: you can set some read-only
variables using the :option command, e.g. :option
-style=xxxx.
- :pop [$]variable
- Removes the last instance of a variable. Use with
:push to change a variable within a block, then reset
it to its previous value.
- :do condition
- Starts a code block that is output repeatedly depending on
condition. Libero defines a standard set of conditions like
:do event. You can also define your own conditions
using :do while The do block ends with a matching
:enddo.
- :do while logical-condition
- Repeats the code block while the logical_condition is
true.
- :enddo [condition]
- Ends the closest previous :do block. If you
specify condition, the :do and :enddo
conditions must match; this makes your schemas more robust
against errors, but is not required.
- :if logical-condition
- Starts a code block that is output if
logical_condition is true. The :if block ends
with a matching :endif.
- :else
- Outputs the following block of code if the previous
:if condition was false.
- :endif [all]
- Ends the closest previous :if block. If you
specify all, all open :ifblocks are
closed.
- :exit [level]
- Aborts code generation. Use levels 0 for okay, 1 for
errors.
- :option -name[=value]
- Enforces a Libero option For example: :option
-style=cobol.
- :internal module
- Tells the code-generator that module is required by
the generated dialog code, but not by the dialog. A typical
case is initialise_the_program. This lets Libero
correctly indicate unused modules in the source code.
- :substr from [size]
- Specifies a substring for the next $name or
$row insertion. From must be from 1 upwards.
If size is not specified, the remainder of the variable's
value is used.