What are the elements of the PlanetPress Talk scripting language?
PlanetPress Talk includes all of the features one expects in a scripting language. It has a defined set of data types (see Data Types) and the following categories of elements that you use to build scripts:
|
Category: |
Description: |
|
Variables |
A variable is a value that changes over time. See Variables. |
|
System objects |
An object is a set of related system variables. For example the physical system object contains the system variables that describe the current x and y coordinates of the drawing pen on the physical page. You reference one of the system variables in an object by prefixing the name of the system object to the name of the variable. For example &physical.x references the x coordinate system variable in the physical system object. |
|
Operators and Operator functions |
An operator is a symbol that performs a common operation. For example, the + is an operator that adds two numbers together or concatenates two strings. An operator function is an operator that does not use a symbol to represent its operation. For example the add command is an operator function. Both operators and operator functions operate on one or more operands. For example the add command operates on two measure or integer values (the operands). See Operators and Operator Functions for a complete list of all operators and operator functions available in PlanetPress Talk. |
|
Procedures |
A procedure performs an action. For example the curveto procedure draws a Bezier curve, the rectangle procedure draws a rectangle, and the setfillcolor procedure sets the fill color. Most procedures require arguments. For example, the rectangle procedure requires six arguments: the x and y coordinates of the upper left hand corner of the rectangle, the width and height of the rectangle, and whether it is filled and/or stroked. |
|
Functions |
A function performs an action and returns a value. For example the inttostr function converts an integer to a string, and returns the value of the resulting string. A function thus has a data type that corresponds to that of the value it returns. You assign the result of a function to a variable or use it as an argument in another command. Most functions require arguments. For example the inttostr command requires a single argument: the integer you want to convert to a string; it returns a string and thus the inttostr function is of type string. |
|
Loop structures |
Repeat a sequence of one or more commands until a specified condition is met. See Loop Structures. |
|
Condition structures |
Control when a sequence of one or more commands executes. See Condition Structures. |
|
Comments |
Provide a means for embedding documentation in your code, or for commenting out lines of code during debugging. See % (procedure). |