[an error occurred while processing this directive] Introduction to Advanced Commands

In addition to parameter settings, if/else/endif statements and output formats. the following commands are available for your use in your form processor configuration file.

These commands are actually Perl subroutines in the Form Processor which you may invoke. A Perl subroutine call has the following format:

&subroutine_name($parameter1, "parameter2", ...);

Note the requirement of the ampersand (&) prefixed to the form processor subroutine name (whereas the built-in Perl routines do not require the ampersand prefix).

All of the subroutines available to you return 0 if successful, and a non-zero value if unsuccessful, so you can test to see whether a command succeeded:

if (!&subroutine($parameter))
# command failed 
else
# command succeeded
endif

The exclamation point means "not", so the above if statement says "if subroutine does not return 0" (since not 0 is TRUE). If this is confusing, just use the simpler form:

if (&subroutine($parameter) != 0)
# command failed 
else
# command succeeded
endif

Each parameter can be a variable or a literal quoted value. Literal numerical and string values do not have to be surrounded by quotes, however, it's a good practice to surround string literals with quotes, since if the string contains any special characters it will not be interpreted correctly (for instance, the literal filename form/file.dat would be interpreted as mathematical division if not surrounded by quotes).

Unless otherwise noted, each of these commands return a numeric value when used in an evaluation (IF statement). To understand more about this, click here.

Index of Advanced Commands [an error occurred while processing this directive]