Display formatted data (FORMAT)
The command allows displaying the content of the currently selected instance in a formatted string. When no instance is selected, instance variables remain empty. One may use the print command in a WHILE of FA loop for displaying a collection of instances.
The format command does not automatically creates a new line at ent of string, i.e. new lines must be specified explicitly.
Parameters:
- fstring - the format string contains fixed text and '%s' variables, which are replaced by values of the parameters passed to the command.
- parm - any variable name or expression, which can be evaluated for the selected instance, can be passed as parameter. All parameters are converted into strings automatically, before being passed to the format string.
- -Dn - re-direction to other data source.
- -Cn - re-direction to other collection in the hierarchy or in the data source referenced by -Dn.
Syntax:
format|f fstring [parm(*)] -Dn -Cn
Examples:
format "hello world\n" // prints a constant text
// print person data in a formaatted line
format "The address of %s %s is %s\n" first_name last_name address