UD S - Unsave Document - Sequential search

(05/22/13)

PURPOSE

Unsaves a set of registers from a document file. If there are multiple lines with the same key unsaves the next such line relative to current location in the file.   Example.

SEE ALSO

UD [Unsave Document]
UD E [Unsave Document - End]
UD N [Unsave Document - get key Numbers from file]
UD IC [Unsave Document - In-core, Retrieve register values]
UD ICE [Unsave Document - End use of In Core document file]

USAGE

.OPERATION: UD S [k], [val1],[val2],[val3]

.DOCUMENT FILE: DOC001
[Enter the name of the file where the registers are to be found. The first variable after 'UD' is used as a key for retrieving the desired register set stored in the document file. In the above example, let us assume [k] has the value: 4. The document file is searched for the next entry under this key number. If this entry consists of the line:
4 3 -1.5 30.8 0.0
then the values -1.5, 30.8, and 0.0 are put into the register variables [val1],[val2],[val3], respectively.]
'
If more register variables are specified on the operation line than exist in the document file line, an error message is printed out. In the above example,
UD S [k],[val1],[val2],[val3],[val4]
would produce an error statement because the number of registers exceeds the three registers present for that key.]

NOTES

  1. Sequential search is much faster than non-sequential, and should be used whenever it is certain that no updates have occurred.

  2. If the specified key is -999 < key < 0 then the routine searches the document file for a line preceeded by a semicolon similar to a comment. This line is treated as as a regular line containing a special key and list of registers. This allows the retrieval of a limited set of values like rotation angles which are somehow associated with the contents of the file. The normal retrieval process (positive keys) treats these lines like comments.

  3. The document file is left open until closed with 'UD E' or until another document file is used with 'UD'. This saves time when there are multiple accesses.

  4. Sequential search means that the document file is searched until the first occurance of the current key is found, starting at the current location in the document file. If a key is not found between the current location and the end of the file the file is rewound to the beginning and a second search for the key commences. At the end of a successful search the file remains open at the line following the retrieved key.

SUBROUTINES

UDOC, OPENDOC, LUNDOC

CALLER

DRIV3