10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PreprocessorGeneral Preprocessor Statement RulesMacro variables are substitution parameters that you can define and give avalue. The preprocessor, when it encounters a macro variable in the sourcefile, substitutes the name with its defined value. In the case where the definedvalue is a character string, the value substituted does not contain thedelimiting quotation marks. A macro variable's scope is global to the framebeing generated from the point in the file where it is defined.There are two types of macro variables that you can use in your 4GL code forpreprocessing purposes:• User-defined macro variablesYou define these in the Frame Editor or Procedure Editor, or in your sourcescript.• Built-in macro variablesThe OpenROAD preprocessor determines the value of these macrovariables each time you compile. You can use these, but you should notchange their values.The following sections describe how to use preprocessor statements with thesemacro variable types.User-defined Macro VariablesYou can define and edit your own macro variables in the Macro Variable Editor.The macro variables you define become part of the frame definition orprocedure.User-defined macro variables can have a length of 32 alphanumericcharacters. The “$” is considered part of the length. These names are notcase-sensitive. Their value cannot evaluate to a preprocessor statement or thename of another macro variable. Macro variables' duration begins when theyare defined, and they exist throughout the remainder of a source file.If you define a macro variable in one field script and then use the macrovariable in another field script, processing errors may occur because of theorder in which the field scripts are processed. To avoid this error when using amacro variable throughout a frame, declare the macro variable in the framescript or create it interactively.You can also define macro variables in a script for frames, procedures, or userclasses with the #define statement. After a macro variable is defined, it isdefined for the rest of the script until it is undefined (with the #undefstatement).Preprocessing Your 4GL Code 435

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!