Searching - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

Searching ....
It is possible to search through the stored records looking for a particular entry.
The command:
I BAN
K FIN D ,
@
<return code> , <searched for string>
[, <starting record number>[, <finishing record number>]]
.... will scan all the RAMrecords. The <starting record number> specifies from which
record the search starts. If the parameter is omitted, then the current record number
is used.
The search will proceed, in steps of <RAMrecord length>, throughout the whole ofthe
second 64K of memory until a match is found.
If a <finishing record number> is specified, then the search will terminate after that
record has been tested (unless a match has been found before that point).
If the search is successful, then the current record number is set to point at the record
where the match was found (otherwise it remains unaffected).
<return code> is an integer variable which returns the record number where the
match was found (if the operation was successful) or a negative error code if the
search operation has failed in some way.
- 1 End of File. The starting record number's address exceeds 64K or exceeds the
finishing record number.
-2
No match found.
- 3 Bank switching failure (should never happen).
The <searched for string> may contain wild-cards, signalled by nulls - CH R $ ( 0 ) , and
the comparison is made with reference to either the <RAMrecord length> or the length
of the <searched for string>, whichever is the shorter.
Examples:
IBANKFIND,@r%,"123 test",0
IBANKFIND,@r%,f$,100,200
Chapter 8 Page 6
More About the Bank Manager ....

Advertisement

Table of Contents
loading

Table of Contents