![]() Appendix C: Logic Line Arrays |
![]() DEVELOPER |
![]() |
There are several attributes in the PROIV Developer File Definitions which are used to hold information regarding the validity or type of a specific logic line, or for cross-referencing a specific line to an object or logic command.
In Version 5, these attributes were simple arrays of 999 elements but for Version 6 have been altered to be arrays of 40, 250 character strings. This provides enough storage for 9,999 logic lines, while keeping record sizes to a minimum. While setting the flag for an individual line has a small overhead compared with directly updating an array element, there is improved efficiency when reinitialising the array, or when searching for a state or cross-reference as fewer iterations are required.
To set or read the value for a specific logic line from the new string arrays, the following logic can be used to calculate the array element, and string position:
#ArrayElement = INT(#LogicLine / 250)
#StringPosition = REM(#LogicLine, 250)
IF #StringPosition = 0 THEN
#StringPosition = 250
ELSE
#ArrayElement += 1
ENDIF
It is assumed that the value of #LogicLine will have been tested to ensure it is in the range 1 to 9999.
The @LGSQ_ARRAY and @LOGIC_LN_ERROR attributes hold Boolean information to indicate a reference or error on a particular line. The value for the relevant array element and string position is either "Y" to indicate True, or null (empty) to indicate False.
The @LOGIC_LN_TYPE attribute holds information regarding the type of a logic line.
For each logic line, the value of the corresponding array element and string position is as follows:
Value |
Type of Logic Line |
null (emtpy) |
Empty or containing standard PROIV logic text |
C |
The entire line is a comment |
S |
The logic line contains the start of an SQL block. (SQL statement) |
Q |
The logic line is within an SQL block and only contains SQL code |
L |
The logic line contains the end of an SQL block. (EndSQL statement) |
s (lowercase) |
The logic line contains a single-line SQL block. (Both SQL and EndSQL statements) |
The @LOGIC_LN_TYPE attribute can be used when performing logic text search and replaces to efficiently filter out lines which should not be processed, or to indicate the presence of non-PROIV code.
Topic ID: 500663