Inquisitor

Reference

  • Data Statement
  • Delete Record
  • Field Write
  • Finalization Section
  • Group Section
  • IF Statement
  • Initialization Section
  • Operators
  • Output All Matches
  • Print
  • Print Separator
  • Query Section
  • Record Statement
  • Remove Trailing Blanks

DATA STATEMENT
Written as #<name>:=<value> where #<name> is the data variable identifier, and the <name> part is alphanumeric. The <value> part is one of logical expression, arithmetic expression, or string expression.

Examples:

#A:=(10.0) #HOLEID:=($HOLE:NAME + '001')

DELETE RECORD
Command to delete a record from the database via a reference in a record variable. If the header record of a relationship group is deleted, then the entire group will be deleted.

Examples:

DELETE_RECORD $HOLE DELETE_RECORD $ROCK_SECT[PREV_MATCH]

FIELD WRITE
Command to set the value of a field of a record on the database, via a reference in a record variable.

Examples:

FIELD_WRITE $HOLE:NAME:=($HOLE:NAME + '001') FIELD_WRITE $ROCK_SECT:THICK:=#THICKNESS FIELD_WRITE $ROCK_SECT[PREVIOUS]:BASE:=$ROCK_SECT[CURRENT].TOP

FINALIZATION SECTION
The section of the Inquisitor script that is executed once on completion of the querying of all of the relationship groups required. This section of the script is delineated by starting with the line:

QL_FINALIZATION:

GROUP SECTION
The section of the Inquisitor script that is executed on the SUCCESSFUL completion of a query for a relationship group. This section of the script is delineated by starting with the line:

QL_GROUP:

IF STATEMENT
The if statement allows program control through a section of the script. The format of the if statement is as follows for a STATEMENT:

IF (logical expression) THEN STATEMENT(s) ELSE STATEMENT(s) ENDIF

Example:

IF ($ROCK_SECT:SAMPID != '' ) THEN $ASSAY:=ASSAY: (SAMPID == $ROCK_SECT:SAMPID) #GOLD:=($ASSAY:GOLD) ELSE #GOLD:=(0.0) ENDIF
A similar structure exists for EXEC_STATEMENTs:
E_IF (logical expression) THEN EXEC_STATEMENT(s) ELSE EXEC_STATEMENT(s) ENDIF

Example:

E_IF (#GOLD < 0.01) THEN PRINT "No worthwhile gold found" ELSE PRINT "Gold assayed at "%s #GOLD%10.2f "g/tonne"%s ENDIF

In both forms the ELSE clause is optional, and the number of statements in either clause can be 0..n, so that null causes can be established if required. In both cases if statements can be nested if required.

INITIALIZATION SECTION
The section of the Inquisitor script that is executed once before the querying of any of the relationship groups is done. This section of the script is delineated by starting with the line:

QL_INITIALIZATION:


OPERATORS

See the Expressions section.

OUTPUT ALL MATCHES

To suppress the output of all matches to just the first match, issue the statement:

QL_OUTPUT_ALL_MATCHES.FALSE.

To reinstate the output of all matches, issue the statement:

QL_OUTPUT_ALL_MATCHES.TRUE.

PRINT
The statement to print out any item, or any number of items 0..n.

Examples:

PRINT PRINT #A PRINT $HOLE:NAME #GOLD PRINT $HOLE:NAME%-20s #GOLD%10.2f

Any or all items can be formatted as required (the optional % clause). See the Exec Statements section for a detailed description.

PRINT SEPARATOR
When not being formatted, the separator character, by default a space, separates the items printed by a PRINT command. To set this to something else, issue the command, for example:

QL_PRINTSEPARATOR (',')

See the Exec Statements section for a detailed description.

QUERY SECTION

The key part of the Inquisitor script, this section is compulsory. This contains the STATEMENTS and optional EXEC_Statements to query each relationship group. This section of the script is delineated by the line:

QL_QUERY:

RECORD STATEMENT

The record querying statement that sets the record variable. It has the structure:

$<name>:=<record type> (logical expression) [|]

where $<name> = the record variable identifier and is alphanumeric; <record type> = the type of record on the database to be queried in the current relationship group; logical expression = the test to be made to see if the record is acceptable; | = the optional alternative conjunction that specifies if the logic flow is to pass through this statement even if the test failed. See the Record Statement section for a detail discussion.

REMOVE TRAILING BLANKS

When reading string fields from databases, any trailing blanks are stripped off by default. To top this behaviour issue the command:

QL_REMOVE_TRAILING_BLANKS.FALSE.