|
|
Tip #6 Dummy VariablesIn my work with filePro, I see a lot of code written by other consultants and end-users. Some older code and techniques with dummy variables could use a new coat of paint. Here are the current rules: Maximum number of characters in a dummy variable: 32,768 characters (Page 13-143 filePro 3.0 Manual) Defining a dummy variable All memory for dummy variables is allocated when the table is loaded, so the location of the definition in the table is not important. If it defined more than once, only the last definition is used. (Don't do this as a rule.) Also if it defined as global in the automatic table, it will be defined for every table that is used with the automatic table, i.e. scan/select, input, output, calls and chains. aa(10) -------- it is not necessary to specify the "*" edit. aa(10,*) is assumed. aa(10,,g) ------ two commas and add the "g" for global variables. Again the * is assumed.
Just a listing with no assignment of value is enough to establish the dummy field definitions. Arrays Use an array to quickly define a list of variables and use the array to clear the variables.
Now you have aa, ab, ac, ad, ae, af, ag, ah, ai, aj, available and defined. To clear the values just issue the command:
This type of variable will not be displayed on the cross-reference table unless an assignment is made to it in the processing. On a short array, I might use this command line to clear the array just to be sure it is listed on the cross-reference list.
Not too much longer. Undefined variables A dummy variable that is not defined, will use a new memory location each time an assignment is made to that variable. Use this type of variable over and over to test if a field is changed during input. Without a definition it will hold any type of data.
Be careful to only leave variables undefined by intention not accident. Written by Nancy Palmquist at nlp@vss3.com. |