Macro Programming Language 151
FXDeko User’s Guide
MACRO PROGRAMMING LANGUAGE
The FXDeko Macro Programming Language combines many of the features of C
and BASIC. It supports many standard programming constructs such as real and
integer arithmetic, variables, arrays, objects, loops, conditional statements and
subroutines.
Since each topic in this chapter builds upon information covered in previous
topics, we suggest you read the topics in the order presented, especially if you
are new to programming.
If you have done some programming, a quick review of this section may be all
you need to start writing your own FXDeko macros.
COMMANDS
Commands are the basic building blocks of any macro. In macros, commands are
similar to the verbs, or action words, we use in speech.
A command is a direct instruction to FXDeko to perform a function. An FXDeko
command may include alphanumeric characters and underscores (_). The first
character may not be a number. A few examples of valid commands are:
justify
rotate
str2num
edge_shader
FXDeko commands fall into several categories. Some categories correspond
directly with items on the FXDeko menu bar (e.g., File, Edit, Channel, Layer,
Macro, Sequence, etc.). Other categories exist for commands that are language
specific, such as program flow commands (e.g. if, while, return) and
mathematical functions (e.g., sqrt, cosine).
The FXDeko Commands section in this manual lists all FXDeko commands by
category.
COMMAND SYNTAX
Earlier, we compared commands to verbs. Just as adverbs modify a verb,
parameters modify a command.
Each command’s parameters are specified in an order particular to that command.
The example below shows the usual order of parameters for the justify
command:
justify [horizontal=] [vertical=]
In addition to a specific position, each parameter has a name, a keyword, such as
“horizontal”, “vertical”, etc. Because each parameter has a specific position in
command declaration, however, using a keyword to assign a value is necessary
only when the parameter is specified out of its usual order.
Even then, you may abbreviate a keyword to only as many characters as
necessary to avoid ambiguity.