MODE
MODE
[
P
RINT ]
S
ET
E
XACT relno#, relno#+1
O
N
OF
F
S
S
S
ET
ET
ET
H
OF
O
N
OF
F
CLOSE
#
CLOSE ALL
F
ORMAT
S
AVE
R
ESET
M
ORE
ON
OF
F
sets (on or off), displays or prints the status setting of some control variables.
arguments
MODE SET
EXACT note see also
An unqualified MODE command displays the status settings of some system items.
[ PRINT ] prints the status settings of some system items.
To determine whether INFO will permit a partial key match determined by the value in the common related item.
With blank in the selected record key for example, it will position to the first record on the related file. By using
NEXT against this file, the whole file can be read. It can be used interactively, in odd or even sections, and in IPFs.
MODE S ET E XACT [RELNO1, RELNOn] [ O N] [ OF F]
n
Data generating options on the specified related file, or any files tree-structured to those files, will be disabled while EXACT is on to prevent unnecessary records being generated. When set on, the read-only system item
$EXACT (occurs 10 indexed by $IDX2) will hold a value of
1.
FIRST
NEXT
INFO Reference Manual Commands 347
MODE example
SEL TRANS
REL CUSTOMER BY CUSTOMER-NAME FILL
RESEL BY $RECNO = 1
/* disable fill option and enable partial-match
MODE SET EXACT 1 ON
MOVE''TO CUSTOMER-NAME
NEXT 1
/* display ALL of the CUSTOMER-NAMEs on the file
/* CUSTOMER starting with the first one
DISP $1CUSTOMER-NAME
MOVE 'B' TO CUSTOMER-NAME
/* will display only the customers who have 'B' in
/* the first character position in CUSTOMER-NAME
DISP $1CUSTOMER-NAME
/* re-enable the FILL option, and return to the
/* normal full-field-width match
MODE SET EXACT 1 OFF
NEXT
The condition of EXACT [RELNO] ON will revert to OFF when the RELATE is broken, i.e. it will not be carried forward to any subsequent file opened on the same REL number.
MODE SET HOF MODE S ET H OF [ O N] [ OF F] [ CLOSE n] [ CLOSE ALL ]
(hold files open)
To control whether ISAM files are to be passively held open
PRIME only within INFO once actively opened within a SELECT /
RELATE structure, even though they are not held within the current SELECT / RELATE structure. The reason for this facility is once the file is open, it can be re-introduced into the active SELECT / RELATE set without incurring a large run-time overhead.
arguments
HOF ON will hold up to a maximum of 60 ISAM files outside of the SELECT / RELATE structure. If the file
(referenced through the EXTERNAL command) is subsequently SELECTed or RELATEd then it will not be re-opened via the ISAM file sub-system but the table reference will merely be snapped within INFO. When set on, the read-only system item $HOF will hold a value of 1.
348 Commands INFO Reference Manual
notes example
MODE
HOF OFF will hold open all files opened under HOF but not add any more to the list. $HOF will be set to 0. This is the default.
HOF CLOSE [#] where # is a number between 1 and 60
(the order in which the files were first selected) will close a given file passively held open within HOF.
HOF CLOSE ALL will close all passively opened files not within the active file set and set $HOF to 0.
If files are opened within the SELECT / RELATE structure they will be held open but removed from the HOF table.
n
Up to 60 ISAM files can be held open, and can be passed open between different INFO usernames using the new
QUIT <username> syntax.
n
HOF [ON] does not in any way impact on the creation or re-use of bitmap files. These will be built or re-used as before.
An application uses 12 ISAM files, of which 5 are frequently used in different programs. A PROFILE could set HOF ON and SELECT each of these 5 files in turn — so that they would all be opened and the EXTERNAL references be resolved as part of the system initialization.
HOF is then set to OFF, so preventing further files from being added to the set. SELECTing or RELATing these files subsequently will be a very fast procedure.
INFO Reference Manual Commands 349
MODE
PROGRAM PROFILE
/* set HOF ON
MODE SET HOF ON
/* open the ISAM master files at
/* beginning of the application
SELECT CUSTOMER-FILE D
SELECT STOCK-FILE D
SELECT ORDER-HEADER D
SELECT ORDER-LINES D
SELECT INVOICES D
/* set HOF OFF — all files held open
/* no more to be added to the list at this time
MODE SET HOF OFF
.
.
RUN ORDER-ENQUIRY
.
.
.
.
PROGRAM ORDER-ENQUIRY
/* snap back onto the ISAM files which have
/* been left open under HOF
SELECT ORDER-LINES
RELATE ORDER-HEADER BY ORDER-NUMBER
RELATE STOCK 2 BY PRODUCT-CODE
RELATE CUSTOMER 3 BY $1CUSTOMER-CODE
MODE SET
FORMAT
MODE S ET F ORMAT [ S AVE] [ R ESET]
The formatting of the 320-byte internal variable buffer may be saved off and reset at a later time, or in another part of a program.
note
MODE SET
MORE
n
The one restriction on the use of the command is that in programs, formats saved by a calling program may only be reset in the program it calls if the two programs were compiled together, i.e. as long as they had the variables formatted the same at the time of compilation
MODE S ET M ORE [ ON ] [ OF F]
This determines whether INFO prompts MORE? when sending more than a screen full of output to a terminal.
The default is ON.
350 Commands INFO Reference Manual