Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_28.ADF » F/+HINT7

F/+HINT7

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_28.ADF
Filename: F/+HINT7
Read OK:
File size: 1770 bytes
Load address: 48204556
Exec address: 33544E49
File contents
Data File Control

These routines give the utility access to the database data file, using the
current select file if required.  It is only possible to read sequentially
through the data file using these calls, but the data will be returned in
sorted order if the selected data was sorted.

The utility should not close the intermediate file if it uses it.  This is
done automatically when control is returned to the ROM.

        INIIMF          Initialise data sequence.  Called to start the data
                        reading sequence.
        MXTIMF          Get next from data sequence. Each call returns the
                        next data record in the sequence.


INIIMF

This routine is called to initiate a sequence of data transfers.  It opens
the main data file, and stores its handle in the location EFILE.  According
to the state of the carry flag on entry, it asks the user if he wishes to
use a select file.  The user responds with a yes or no, and ViewStore opens
the select file (S.database) accordingly.  After this, the select file is
transparent to the utility; repeated calls to NXTIMF will either return all
the records in the data file if the select file is not being used, or the
subset of records in the select file, if specified.

On entry:               CC      Don't ask "Use select file (Y,N)?" question.
                        CS      Ask select file question.

On exit:                VC      No error.
                        VS      Error; error code in A.

NXTIME

After starting the sequence with a call to INIIMF, repeated calls to MXTIMF
return the records in the data file one by one.

On entry:               A               low byte of address to store record.
                        Y               high byte of address to store
                                        record.
                        TEMP13          address of the byte after the last
                                        byte available to store the record.

On exit:                VC              No error.
                        VS              Error; error code in A.

                        CC              Not end of file.
                        CS              End of file (returned on the call
                                        after the last record has been
                                        processed).

Errors

Many of the ROM routines can return an error status.  An error is usually
indicated by either the Carry flag (C), or the Overflow flag (V).  When an
error is indicated, the error code is in the A register.  To report the
error to the user, call the routine REPERL with this code A.  The various
error codes and messages are summarised later.  A utility can use a ROM
error message by loading the appropriate code into A, and calling REPERL.

All file calls have the same error trapping system: after a call, V is set
to indicate an error, clear if there was no error.  This includes errors
causing a BRK, that is control is returned to the calling routine even when
a BRK is occurred.  When you call REPERL with the returned error code, the
BRK message will be reported as normal.

REPERL

Reports the error message for the error code in A:

On entry:         A             contains error code.

On exit:          A,X,Y         undefined.


Field and Record Control

Much of ViewStore's manipulation is on fields and records; accordingly,
there are several routines available to make this easier.  There are some
routines to locate fields in the header, format file or current record;
routines to compare field values; and routines to find the size of a given
field.

Most of these routines use the two temporaries TEMP06 and TEMP07. TEMP06
points to either a field within the format file, or a field within the
current record. TEMP07 points to a field within the current record.  The Y
indirect indexed addressing mode is used in conjunction with these
temporaries to access the field contents: the temporary points to the
beginning of the field, and the Y register gives the offset from there.

Remember that the format file itself is in the same format as a data file.
The same routines are used to process information in records of the database
as in the format file itself.  For each field in the database, there is a
record in the format file, and this record details the characteristics of
its corresponding field in the database.  The header record is the first
record in the format file.

Data Format

The data format is summarised in table 10 at the end of the document.  All
fields in ViewStore are stored in ASCII, even numbers and dates; each field
ends with an end of field marker; each record ends with an end of record
marker; and the file ends with an end of file marker; after the end of file
marker, the file is padded up to the physical end of file with null
characters.  If you are processing a field's contents, you should test for
the end of field using the CHKEOF and CHKEOR routines.  These routines set
the flags according to the character that they find.  Don't check for the
character value explicitly.

Generally, when you make a call to a routine that locates a field, the x
register indicates where the field is to be found:

        X=0             Field in header; A has field number.
        X=1 to 254      Field in format file; X gives format file record
                        number; A has field number.  The field numbers of
                        the various format file fields are summarised below.
        X=225           Field in current record; A has field number; Y has
                        record number.

Fields within a record are numbered from 1 to 254.  If you ask for a field
which is not in the record, the routine will return with the Carry flag set. 
Whereas ViewStore knows where the format file is located, the address of the
current record could be anywhere, and before fields within the current
record can be accessed, you must tell ViewStore its address with the SETDPS
routine.

00000000  0d 44 61 74 61 20 46 69  6c 65 20 43 6f 6e 74 72  |.Data File Contr|
00000010  6f 6c 0d 0d 54 68 65 73  65 20 72 6f 75 74 69 6e  |ol..These routin|
00000020  65 73 20 67 69 76 65 20  74 68 65 20 75 74 69 6c  |es give the util|
00000030  69 74 79 20 61 63 63 65  73 73 20 74 6f 20 74 68  |ity access to th|
00000040  65 20 64 61 74 61 62 61  73 65 20 64 61 74 61 20  |e database data |
00000050  66 69 6c 65 2c 20 75 73  69 6e 67 20 74 68 65 0d  |file, using the.|
00000060  63 75 72 72 65 6e 74 20  73 65 6c 65 63 74 20 66  |current select f|
00000070  69 6c 65 20 69 66 20 72  65 71 75 69 72 65 64 2e  |ile if required.|
00000080  20 20 49 74 20 69 73 20  6f 6e 6c 79 20 70 6f 73  |  It is only pos|
00000090  73 69 62 6c 65 20 74 6f  20 72 65 61 64 20 73 65  |sible to read se|
000000a0  71 75 65 6e 74 69 61 6c  6c 79 0d 74 68 72 6f 75  |quentially.throu|
000000b0  67 68 20 74 68 65 20 64  61 74 61 20 66 69 6c 65  |gh the data file|
000000c0  20 75 73 69 6e 67 20 74  68 65 73 65 20 63 61 6c  | using these cal|
000000d0  6c 73 2c 20 62 75 74 20  74 68 65 20 64 61 74 61  |ls, but the data|
000000e0  20 77 69 6c 6c 20 62 65  20 72 65 74 75 72 6e 65  | will be returne|
000000f0  64 20 69 6e 0d 73 6f 72  74 65 64 20 6f 72 64 65  |d in.sorted orde|
00000100  72 20 69 66 20 74 68 65  20 73 65 6c 65 63 74 65  |r if the selecte|
00000110  64 20 64 61 74 61 20 77  61 73 20 73 6f 72 74 65  |d data was sorte|
00000120  64 2e 0d 0d 54 68 65 20  75 74 69 6c 69 74 79 20  |d...The utility |
00000130  73 68 6f 75 6c 64 20 6e  6f 74 20 63 6c 6f 73 65  |should not close|
00000140  20 74 68 65 20 69 6e 74  65 72 6d 65 64 69 61 74  | the intermediat|
00000150  65 20 66 69 6c 65 20 69  66 20 69 74 20 75 73 65  |e file if it use|
00000160  73 20 69 74 2e 20 20 54  68 69 73 20 69 73 0d 64  |s it.  This is.d|
00000170  6f 6e 65 20 61 75 74 6f  6d 61 74 69 63 61 6c 6c  |one automaticall|
00000180  79 20 77 68 65 6e 20 63  6f 6e 74 72 6f 6c 20 69  |y when control i|
00000190  73 20 72 65 74 75 72 6e  65 64 20 74 6f 20 74 68  |s returned to th|
000001a0  65 20 52 4f 4d 2e 0d 0d  20 20 20 20 20 20 20 20  |e ROM...        |
000001b0  49 4e 49 49 4d 46 20 20  20 20 20 20 20 20 20 20  |INIIMF          |
000001c0  49 6e 69 74 69 61 6c 69  73 65 20 64 61 74 61 20  |Initialise data |
000001d0  73 65 71 75 65 6e 63 65  2e 20 20 43 61 6c 6c 65  |sequence.  Calle|
000001e0  64 20 74 6f 20 73 74 61  72 74 20 74 68 65 20 64  |d to start the d|
000001f0  61 74 61 0d 20 20 20 20  20 20 20 20 20 20 20 20  |ata.            |
00000200  20 20 20 20 20 20 20 20  20 20 20 20 72 65 61 64  |            read|
00000210  69 6e 67 20 73 65 71 75  65 6e 63 65 2e 0d 20 20  |ing sequence..  |
00000220  20 20 20 20 20 20 4d 58  54 49 4d 46 20 20 20 20  |      MXTIMF    |
00000230  20 20 20 20 20 20 47 65  74 20 6e 65 78 74 20 66  |      Get next f|
00000240  72 6f 6d 20 64 61 74 61  20 73 65 71 75 65 6e 63  |rom data sequenc|
00000250  65 2e 20 45 61 63 68 20  63 61 6c 6c 20 72 65 74  |e. Each call ret|
00000260  75 72 6e 73 20 74 68 65  0d 20 20 20 20 20 20 20  |urns the.       |
00000270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000280  20 6e 65 78 74 20 64 61  74 61 20 72 65 63 6f 72  | next data recor|
00000290  64 20 69 6e 20 74 68 65  20 73 65 71 75 65 6e 63  |d in the sequenc|
000002a0  65 2e 0d 0d 0d 49 4e 49  49 4d 46 0d 0d 54 68 69  |e....INIIMF..Thi|
000002b0  73 20 72 6f 75 74 69 6e  65 20 69 73 20 63 61 6c  |s routine is cal|
000002c0  6c 65 64 20 74 6f 20 69  6e 69 74 69 61 74 65 20  |led to initiate |
000002d0  61 20 73 65 71 75 65 6e  63 65 20 6f 66 20 64 61  |a sequence of da|
000002e0  74 61 20 74 72 61 6e 73  66 65 72 73 2e 20 20 49  |ta transfers.  I|
000002f0  74 20 6f 70 65 6e 73 0d  74 68 65 20 6d 61 69 6e  |t opens.the main|
00000300  20 64 61 74 61 20 66 69  6c 65 2c 20 61 6e 64 20  | data file, and |
00000310  73 74 6f 72 65 73 20 69  74 73 20 68 61 6e 64 6c  |stores its handl|
00000320  65 20 69 6e 20 74 68 65  20 6c 6f 63 61 74 69 6f  |e in the locatio|
00000330  6e 20 45 46 49 4c 45 2e  20 20 41 63 63 6f 72 64  |n EFILE.  Accord|
00000340  69 6e 67 0d 74 6f 20 74  68 65 20 73 74 61 74 65  |ing.to the state|
00000350  20 6f 66 20 74 68 65 20  63 61 72 72 79 20 66 6c  | of the carry fl|
00000360  61 67 20 6f 6e 20 65 6e  74 72 79 2c 20 69 74 20  |ag on entry, it |
00000370  61 73 6b 73 20 74 68 65  20 75 73 65 72 20 69 66  |asks the user if|
00000380  20 68 65 20 77 69 73 68  65 73 20 74 6f 0d 75 73  | he wishes to.us|
00000390  65 20 61 20 73 65 6c 65  63 74 20 66 69 6c 65 2e  |e a select file.|
000003a0  20 20 54 68 65 20 75 73  65 72 20 72 65 73 70 6f  |  The user respo|
000003b0  6e 64 73 20 77 69 74 68  20 61 20 79 65 73 20 6f  |nds with a yes o|
000003c0  72 20 6e 6f 2c 20 61 6e  64 20 56 69 65 77 53 74  |r no, and ViewSt|
000003d0  6f 72 65 20 6f 70 65 6e  73 0d 74 68 65 20 73 65  |ore opens.the se|
000003e0  6c 65 63 74 20 66 69 6c  65 20 28 53 2e 64 61 74  |lect file (S.dat|
000003f0  61 62 61 73 65 29 20 61  63 63 6f 72 64 69 6e 67  |abase) according|
00000400  6c 79 2e 20 20 41 66 74  65 72 20 74 68 69 73 2c  |ly.  After this,|
00000410  20 74 68 65 20 73 65 6c  65 63 74 20 66 69 6c 65  | the select file|
00000420  20 69 73 0d 74 72 61 6e  73 70 61 72 65 6e 74 20  | is.transparent |
00000430  74 6f 20 74 68 65 20 75  74 69 6c 69 74 79 3b 20  |to the utility; |
00000440  72 65 70 65 61 74 65 64  20 63 61 6c 6c 73 20 74  |repeated calls t|
00000450  6f 20 4e 58 54 49 4d 46  20 77 69 6c 6c 20 65 69  |o NXTIMF will ei|
00000460  74 68 65 72 20 72 65 74  75 72 6e 20 61 6c 6c 0d  |ther return all.|
00000470  74 68 65 20 72 65 63 6f  72 64 73 20 69 6e 20 74  |the records in t|
00000480  68 65 20 64 61 74 61 20  66 69 6c 65 20 69 66 20  |he data file if |
00000490  74 68 65 20 73 65 6c 65  63 74 20 66 69 6c 65 20  |the select file |
000004a0  69 73 20 6e 6f 74 20 62  65 69 6e 67 20 75 73 65  |is not being use|
000004b0  64 2c 20 6f 72 20 74 68  65 0d 73 75 62 73 65 74  |d, or the.subset|
000004c0  20 6f 66 20 72 65 63 6f  72 64 73 20 69 6e 20 74  | of records in t|
000004d0  68 65 20 73 65 6c 65 63  74 20 66 69 6c 65 2c 20  |he select file, |
000004e0  69 66 20 73 70 65 63 69  66 69 65 64 2e 0d 0d 4f  |if specified...O|
000004f0  6e 20 65 6e 74 72 79 3a  20 20 20 20 20 20 20 20  |n entry:        |
00000500  20 20 20 20 20 20 20 43  43 20 20 20 20 20 20 44  |       CC      D|
00000510  6f 6e 27 74 20 61 73 6b  20 22 55 73 65 20 73 65  |on't ask "Use se|
00000520  6c 65 63 74 20 66 69 6c  65 20 28 59 2c 4e 29 3f  |lect file (Y,N)?|
00000530  22 20 71 75 65 73 74 69  6f 6e 2e 0d 20 20 20 20  |" question..    |
00000540  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000550  20 20 20 20 43 53 20 20  20 20 20 20 41 73 6b 20  |    CS      Ask |
00000560  73 65 6c 65 63 74 20 66  69 6c 65 20 71 75 65 73  |select file ques|
00000570  74 69 6f 6e 2e 0d 0d 4f  6e 20 65 78 69 74 3a 20  |tion...On exit: |
00000580  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 56  |               V|
00000590  43 20 20 20 20 20 20 4e  6f 20 65 72 72 6f 72 2e  |C      No error.|
000005a0  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000005b0  20 20 20 20 20 20 20 20  20 56 53 20 20 20 20 20  |         VS     |
000005c0  20 45 72 72 6f 72 3b 20  65 72 72 6f 72 20 63 6f  | Error; error co|
000005d0  64 65 20 69 6e 20 41 2e  0d 0d 4e 58 54 49 4d 45  |de in A...NXTIME|
000005e0  0d 0d 41 66 74 65 72 20  73 74 61 72 74 69 6e 67  |..After starting|
000005f0  20 74 68 65 20 73 65 71  75 65 6e 63 65 20 77 69  | the sequence wi|
00000600  74 68 20 61 20 63 61 6c  6c 20 74 6f 20 49 4e 49  |th a call to INI|
00000610  49 4d 46 2c 20 72 65 70  65 61 74 65 64 20 63 61  |IMF, repeated ca|
00000620  6c 6c 73 20 74 6f 20 4d  58 54 49 4d 46 0d 72 65  |lls to MXTIMF.re|
00000630  74 75 72 6e 20 74 68 65  20 72 65 63 6f 72 64 73  |turn the records|
00000640  20 69 6e 20 74 68 65 20  64 61 74 61 20 66 69 6c  | in the data fil|
00000650  65 20 6f 6e 65 20 62 79  20 6f 6e 65 2e 0d 0d 4f  |e one by one...O|
00000660  6e 20 65 6e 74 72 79 3a  20 20 20 20 20 20 20 20  |n entry:        |
00000670  20 20 20 20 20 20 20 41  20 20 20 20 20 20 20 20  |       A        |
00000680  20 20 20 20 20 20 20 6c  6f 77 20 62 79 74 65 20  |       low byte |
00000690  6f 66 20 61 64 64 72 65  73 73 20 74 6f 20 73 74  |of address to st|
000006a0  6f 72 65 20 72 65 63 6f  72 64 2e 0d 20 20 20 20  |ore record..    |
000006b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000006c0  20 20 20 20 59 20 20 20  20 20 20 20 20 20 20 20  |    Y           |
000006d0  20 20 20 20 68 69 67 68  20 62 79 74 65 20 6f 66  |    high byte of|
000006e0  20 61 64 64 72 65 73 73  20 74 6f 20 73 74 6f 72  | address to stor|
000006f0  65 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |e.              |
00000700  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000710  20 20 20 20 20 20 20 20  20 20 72 65 63 6f 72 64  |          record|
00000720  2e 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00000730  20 20 20 20 20 20 20 20  20 20 54 45 4d 50 31 33  |          TEMP13|
00000740  20 20 20 20 20 20 20 20  20 20 61 64 64 72 65 73  |          addres|
00000750  73 20 6f 66 20 74 68 65  20 62 79 74 65 20 61 66  |s of the byte af|
00000760  74 65 72 20 74 68 65 20  6c 61 73 74 0d 20 20 20  |ter the last.   |
00000770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000790  20 20 20 20 20 62 79 74  65 20 61 76 61 69 6c 61  |     byte availa|
000007a0  62 6c 65 20 74 6f 20 73  74 6f 72 65 20 74 68 65  |ble to store the|
000007b0  20 72 65 63 6f 72 64 2e  0d 0d 4f 6e 20 65 78 69  | record...On exi|
000007c0  74 3a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |t:              |
000007d0  20 20 56 43 20 20 20 20  20 20 20 20 20 20 20 20  |  VC            |
000007e0  20 20 4e 6f 20 65 72 72  6f 72 2e 0d 20 20 20 20  |  No error..    |
000007f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000800  20 20 20 20 56 53 20 20  20 20 20 20 20 20 20 20  |    VS          |
00000810  20 20 20 20 45 72 72 6f  72 3b 20 65 72 72 6f 72  |    Error; error|
00000820  20 63 6f 64 65 20 69 6e  20 41 2e 0d 0d 20 20 20  | code in A...   |
00000830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000840  20 20 20 20 20 43 43 20  20 20 20 20 20 20 20 20  |     CC         |
00000850  20 20 20 20 20 4e 6f 74  20 65 6e 64 20 6f 66 20  |     Not end of |
00000860  66 69 6c 65 2e 0d 20 20  20 20 20 20 20 20 20 20  |file..          |
00000870  20 20 20 20 20 20 20 20  20 20 20 20 20 20 43 53  |              CS|
00000880  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 6e  |              En|
00000890  64 20 6f 66 20 66 69 6c  65 20 28 72 65 74 75 72  |d of file (retur|
000008a0  6e 65 64 20 6f 6e 20 74  68 65 20 63 61 6c 6c 0d  |ned on the call.|
000008b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000008d0  20 20 20 20 20 20 20 20  61 66 74 65 72 20 74 68  |        after th|
000008e0  65 20 6c 61 73 74 20 72  65 63 6f 72 64 20 68 61  |e last record ha|
000008f0  73 20 62 65 65 6e 0d 20  20 20 20 20 20 20 20 20  |s been.         |
00000900  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000910  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 70  |               p|
00000920  72 6f 63 65 73 73 65 64  29 2e 0d 0d 45 72 72 6f  |rocessed)...Erro|
00000930  72 73 0d 0d 4d 61 6e 79  20 6f 66 20 74 68 65 20  |rs..Many of the |
00000940  52 4f 4d 20 72 6f 75 74  69 6e 65 73 20 63 61 6e  |ROM routines can|
00000950  20 72 65 74 75 72 6e 20  61 6e 20 65 72 72 6f 72  | return an error|
00000960  20 73 74 61 74 75 73 2e  20 20 41 6e 20 65 72 72  | status.  An err|
00000970  6f 72 20 69 73 20 75 73  75 61 6c 6c 79 0d 69 6e  |or is usually.in|
00000980  64 69 63 61 74 65 64 20  62 79 20 65 69 74 68 65  |dicated by eithe|
00000990  72 20 74 68 65 20 43 61  72 72 79 20 66 6c 61 67  |r the Carry flag|
000009a0  20 28 43 29 2c 20 6f 72  20 74 68 65 20 4f 76 65  | (C), or the Ove|
000009b0  72 66 6c 6f 77 20 66 6c  61 67 20 28 56 29 2e 20  |rflow flag (V). |
000009c0  20 57 68 65 6e 20 61 6e  0d 65 72 72 6f 72 20 69  | When an.error i|
000009d0  73 20 69 6e 64 69 63 61  74 65 64 2c 20 74 68 65  |s indicated, the|
000009e0  20 65 72 72 6f 72 20 63  6f 64 65 20 69 73 20 69  | error code is i|
000009f0  6e 20 74 68 65 20 41 20  72 65 67 69 73 74 65 72  |n the A register|
00000a00  2e 20 20 54 6f 20 72 65  70 6f 72 74 20 74 68 65  |.  To report the|
00000a10  0d 65 72 72 6f 72 20 74  6f 20 74 68 65 20 75 73  |.error to the us|
00000a20  65 72 2c 20 63 61 6c 6c  20 74 68 65 20 72 6f 75  |er, call the rou|
00000a30  74 69 6e 65 20 52 45 50  45 52 4c 20 77 69 74 68  |tine REPERL with|
00000a40  20 74 68 69 73 20 63 6f  64 65 20 41 2e 20 20 54  | this code A.  T|
00000a50  68 65 20 76 61 72 69 6f  75 73 0d 65 72 72 6f 72  |he various.error|
00000a60  20 63 6f 64 65 73 20 61  6e 64 20 6d 65 73 73 61  | codes and messa|
00000a70  67 65 73 20 61 72 65 20  73 75 6d 6d 61 72 69 73  |ges are summaris|
00000a80  65 64 20 6c 61 74 65 72  2e 20 20 41 20 75 74 69  |ed later.  A uti|
00000a90  6c 69 74 79 20 63 61 6e  20 75 73 65 20 61 20 52  |lity can use a R|
00000aa0  4f 4d 0d 65 72 72 6f 72  20 6d 65 73 73 61 67 65  |OM.error message|
00000ab0  20 62 79 20 6c 6f 61 64  69 6e 67 20 74 68 65 20  | by loading the |
00000ac0  61 70 70 72 6f 70 72 69  61 74 65 20 63 6f 64 65  |appropriate code|
00000ad0  20 69 6e 74 6f 20 41 2c  20 61 6e 64 20 63 61 6c  | into A, and cal|
00000ae0  6c 69 6e 67 20 52 45 50  45 52 4c 2e 0d 0d 41 6c  |ling REPERL...Al|
00000af0  6c 20 66 69 6c 65 20 63  61 6c 6c 73 20 68 61 76  |l file calls hav|
00000b00  65 20 74 68 65 20 73 61  6d 65 20 65 72 72 6f 72  |e the same error|
00000b10  20 74 72 61 70 70 69 6e  67 20 73 79 73 74 65 6d  | trapping system|
00000b20  3a 20 61 66 74 65 72 20  61 20 63 61 6c 6c 2c 20  |: after a call, |
00000b30  56 20 69 73 20 73 65 74  0d 74 6f 20 69 6e 64 69  |V is set.to indi|
00000b40  63 61 74 65 20 61 6e 20  65 72 72 6f 72 2c 20 63  |cate an error, c|
00000b50  6c 65 61 72 20 69 66 20  74 68 65 72 65 20 77 61  |lear if there wa|
00000b60  73 20 6e 6f 20 65 72 72  6f 72 2e 20 20 54 68 69  |s no error.  Thi|
00000b70  73 20 69 6e 63 6c 75 64  65 73 20 65 72 72 6f 72  |s includes error|
00000b80  73 0d 63 61 75 73 69 6e  67 20 61 20 42 52 4b 2c  |s.causing a BRK,|
00000b90  20 74 68 61 74 20 69 73  20 63 6f 6e 74 72 6f 6c  | that is control|
00000ba0  20 69 73 20 72 65 74 75  72 6e 65 64 20 74 6f 20  | is returned to |
00000bb0  74 68 65 20 63 61 6c 6c  69 6e 67 20 72 6f 75 74  |the calling rout|
00000bc0  69 6e 65 20 65 76 65 6e  20 77 68 65 6e 0d 61 20  |ine even when.a |
00000bd0  42 52 4b 20 69 73 20 6f  63 63 75 72 72 65 64 2e  |BRK is occurred.|
00000be0  20 20 57 68 65 6e 20 79  6f 75 20 63 61 6c 6c 20  |  When you call |
00000bf0  52 45 50 45 52 4c 20 77  69 74 68 20 74 68 65 20  |REPERL with the |
00000c00  72 65 74 75 72 6e 65 64  20 65 72 72 6f 72 20 63  |returned error c|
00000c10  6f 64 65 2c 20 74 68 65  0d 42 52 4b 20 6d 65 73  |ode, the.BRK mes|
00000c20  73 61 67 65 20 77 69 6c  6c 20 62 65 20 72 65 70  |sage will be rep|
00000c30  6f 72 74 65 64 20 61 73  20 6e 6f 72 6d 61 6c 2e  |orted as normal.|
00000c40  0d 0d 52 45 50 45 52 4c  0d 0d 52 65 70 6f 72 74  |..REPERL..Report|
00000c50  73 20 74 68 65 20 65 72  72 6f 72 20 6d 65 73 73  |s the error mess|
00000c60  61 67 65 20 66 6f 72 20  74 68 65 20 65 72 72 6f  |age for the erro|
00000c70  72 20 63 6f 64 65 20 69  6e 20 41 3a 0d 0d 4f 6e  |r code in A:..On|
00000c80  20 65 6e 74 72 79 3a 20  20 20 20 20 20 20 20 20  | entry:         |
00000c90  41 20 20 20 20 20 20 20  20 20 20 20 20 20 63 6f  |A             co|
00000ca0  6e 74 61 69 6e 73 20 65  72 72 6f 72 20 63 6f 64  |ntains error cod|
00000cb0  65 2e 0d 0d 4f 6e 20 65  78 69 74 3a 20 20 20 20  |e...On exit:    |
00000cc0  20 20 20 20 20 20 41 2c  58 2c 59 20 20 20 20 20  |      A,X,Y     |
00000cd0  20 20 20 20 75 6e 64 65  66 69 6e 65 64 2e 0d 0d  |    undefined...|
00000ce0  0d 46 69 65 6c 64 20 61  6e 64 20 52 65 63 6f 72  |.Field and Recor|
00000cf0  64 20 43 6f 6e 74 72 6f  6c 0d 0d 4d 75 63 68 20  |d Control..Much |
00000d00  6f 66 20 56 69 65 77 53  74 6f 72 65 27 73 20 6d  |of ViewStore's m|
00000d10  61 6e 69 70 75 6c 61 74  69 6f 6e 20 69 73 20 6f  |anipulation is o|
00000d20  6e 20 66 69 65 6c 64 73  20 61 6e 64 20 72 65 63  |n fields and rec|
00000d30  6f 72 64 73 3b 20 61 63  63 6f 72 64 69 6e 67 6c  |ords; accordingl|
00000d40  79 2c 0d 74 68 65 72 65  20 61 72 65 20 73 65 76  |y,.there are sev|
00000d50  65 72 61 6c 20 72 6f 75  74 69 6e 65 73 20 61 76  |eral routines av|
00000d60  61 69 6c 61 62 6c 65 20  74 6f 20 6d 61 6b 65 20  |ailable to make |
00000d70  74 68 69 73 20 65 61 73  69 65 72 2e 20 20 54 68  |this easier.  Th|
00000d80  65 72 65 20 61 72 65 20  73 6f 6d 65 0d 72 6f 75  |ere are some.rou|
00000d90  74 69 6e 65 73 20 74 6f  20 6c 6f 63 61 74 65 20  |tines to locate |
00000da0  66 69 65 6c 64 73 20 69  6e 20 74 68 65 20 68 65  |fields in the he|
00000db0  61 64 65 72 2c 20 66 6f  72 6d 61 74 20 66 69 6c  |ader, format fil|
00000dc0  65 20 6f 72 20 63 75 72  72 65 6e 74 20 72 65 63  |e or current rec|
00000dd0  6f 72 64 3b 0d 72 6f 75  74 69 6e 65 73 20 74 6f  |ord;.routines to|
00000de0  20 63 6f 6d 70 61 72 65  20 66 69 65 6c 64 20 76  | compare field v|
00000df0  61 6c 75 65 73 3b 20 61  6e 64 20 72 6f 75 74 69  |alues; and routi|
00000e00  6e 65 73 20 74 6f 20 66  69 6e 64 20 74 68 65 20  |nes to find the |
00000e10  73 69 7a 65 20 6f 66 20  61 20 67 69 76 65 6e 0d  |size of a given.|
00000e20  66 69 65 6c 64 2e 0d 0d  4d 6f 73 74 20 6f 66 20  |field...Most of |
00000e30  74 68 65 73 65 20 72 6f  75 74 69 6e 65 73 20 75  |these routines u|
00000e40  73 65 20 74 68 65 20 74  77 6f 20 74 65 6d 70 6f  |se the two tempo|
00000e50  72 61 72 69 65 73 20 54  45 4d 50 30 36 20 61 6e  |raries TEMP06 an|
00000e60  64 20 54 45 4d 50 30 37  2e 20 54 45 4d 50 30 36  |d TEMP07. TEMP06|
00000e70  0d 70 6f 69 6e 74 73 20  74 6f 20 65 69 74 68 65  |.points to eithe|
00000e80  72 20 61 20 66 69 65 6c  64 20 77 69 74 68 69 6e  |r a field within|
00000e90  20 74 68 65 20 66 6f 72  6d 61 74 20 66 69 6c 65  | the format file|
00000ea0  2c 20 6f 72 20 61 20 66  69 65 6c 64 20 77 69 74  |, or a field wit|
00000eb0  68 69 6e 20 74 68 65 0d  63 75 72 72 65 6e 74 20  |hin the.current |
00000ec0  72 65 63 6f 72 64 2e 20  54 45 4d 50 30 37 20 70  |record. TEMP07 p|
00000ed0  6f 69 6e 74 73 20 74 6f  20 61 20 66 69 65 6c 64  |oints to a field|
00000ee0  20 77 69 74 68 69 6e 20  74 68 65 20 63 75 72 72  | within the curr|
00000ef0  65 6e 74 20 72 65 63 6f  72 64 2e 20 20 54 68 65  |ent record.  The|
00000f00  20 59 0d 69 6e 64 69 72  65 63 74 20 69 6e 64 65  | Y.indirect inde|
00000f10  78 65 64 20 61 64 64 72  65 73 73 69 6e 67 20 6d  |xed addressing m|
00000f20  6f 64 65 20 69 73 20 75  73 65 64 20 69 6e 20 63  |ode is used in c|
00000f30  6f 6e 6a 75 6e 63 74 69  6f 6e 20 77 69 74 68 20  |onjunction with |
00000f40  74 68 65 73 65 0d 74 65  6d 70 6f 72 61 72 69 65  |these.temporarie|
00000f50  73 20 74 6f 20 61 63 63  65 73 73 20 74 68 65 20  |s to access the |
00000f60  66 69 65 6c 64 20 63 6f  6e 74 65 6e 74 73 3a 20  |field contents: |
00000f70  74 68 65 20 74 65 6d 70  6f 72 61 72 79 20 70 6f  |the temporary po|
00000f80  69 6e 74 73 20 74 6f 20  74 68 65 0d 62 65 67 69  |ints to the.begi|
00000f90  6e 6e 69 6e 67 20 6f 66  20 74 68 65 20 66 69 65  |nning of the fie|
00000fa0  6c 64 2c 20 61 6e 64 20  74 68 65 20 59 20 72 65  |ld, and the Y re|
00000fb0  67 69 73 74 65 72 20 67  69 76 65 73 20 74 68 65  |gister gives the|
00000fc0  20 6f 66 66 73 65 74 20  66 72 6f 6d 20 74 68 65  | offset from the|
00000fd0  72 65 2e 0d 0d 52 65 6d  65 6d 62 65 72 20 74 68  |re...Remember th|
00000fe0  61 74 20 74 68 65 20 66  6f 72 6d 61 74 20 66 69  |at the format fi|
00000ff0  6c 65 20 69 74 73 65 6c  66 20 69 73 20 69 6e 20  |le itself is in |
00001000  74 68 65 20 73 61 6d 65  20 66 6f 72 6d 61 74 20  |the same format |
00001010  61 73 20 61 20 64 61 74  61 20 66 69 6c 65 2e 0d  |as a data file..|
00001020  54 68 65 20 73 61 6d 65  20 72 6f 75 74 69 6e 65  |The same routine|
00001030  73 20 61 72 65 20 75 73  65 64 20 74 6f 20 70 72  |s are used to pr|
00001040  6f 63 65 73 73 20 69 6e  66 6f 72 6d 61 74 69 6f  |ocess informatio|
00001050  6e 20 69 6e 20 72 65 63  6f 72 64 73 20 6f 66 20  |n in records of |
00001060  74 68 65 20 64 61 74 61  62 61 73 65 0d 61 73 20  |the database.as |
00001070  69 6e 20 74 68 65 20 66  6f 72 6d 61 74 20 66 69  |in the format fi|
00001080  6c 65 20 69 74 73 65 6c  66 2e 20 20 46 6f 72 20  |le itself.  For |
00001090  65 61 63 68 20 66 69 65  6c 64 20 69 6e 20 74 68  |each field in th|
000010a0  65 20 64 61 74 61 62 61  73 65 2c 20 74 68 65 72  |e database, ther|
000010b0  65 20 69 73 20 61 0d 72  65 63 6f 72 64 20 69 6e  |e is a.record in|
000010c0  20 74 68 65 20 66 6f 72  6d 61 74 20 66 69 6c 65  | the format file|
000010d0  2c 20 61 6e 64 20 74 68  69 73 20 72 65 63 6f 72  |, and this recor|
000010e0  64 20 64 65 74 61 69 6c  73 20 74 68 65 20 63 68  |d details the ch|
000010f0  61 72 61 63 74 65 72 69  73 74 69 63 73 20 6f 66  |aracteristics of|
00001100  0d 69 74 73 20 63 6f 72  72 65 73 70 6f 6e 64 69  |.its correspondi|
00001110  6e 67 20 66 69 65 6c 64  20 69 6e 20 74 68 65 20  |ng field in the |
00001120  64 61 74 61 62 61 73 65  2e 20 20 54 68 65 20 68  |database.  The h|
00001130  65 61 64 65 72 20 72 65  63 6f 72 64 20 69 73 20  |eader record is |
00001140  74 68 65 20 66 69 72 73  74 0d 72 65 63 6f 72 64  |the first.record|
00001150  20 69 6e 20 74 68 65 20  66 6f 72 6d 61 74 20 66  | in the format f|
00001160  69 6c 65 2e 0d 0d 44 61  74 61 20 46 6f 72 6d 61  |ile...Data Forma|
00001170  74 0d 0d 54 68 65 20 64  61 74 61 20 66 6f 72 6d  |t..The data form|
00001180  61 74 20 69 73 20 73 75  6d 6d 61 72 69 73 65 64  |at is summarised|
00001190  20 69 6e 20 74 61 62 6c  65 20 31 30 20 61 74 20  | in table 10 at |
000011a0  74 68 65 20 65 6e 64 20  6f 66 20 74 68 65 20 64  |the end of the d|
000011b0  6f 63 75 6d 65 6e 74 2e  20 20 41 6c 6c 0d 66 69  |ocument.  All.fi|
000011c0  65 6c 64 73 20 69 6e 20  56 69 65 77 53 74 6f 72  |elds in ViewStor|
000011d0  65 20 61 72 65 20 73 74  6f 72 65 64 20 69 6e 20  |e are stored in |
000011e0  41 53 43 49 49 2c 20 65  76 65 6e 20 6e 75 6d 62  |ASCII, even numb|
000011f0  65 72 73 20 61 6e 64 20  64 61 74 65 73 3b 20 65  |ers and dates; e|
00001200  61 63 68 20 66 69 65 6c  64 0d 65 6e 64 73 20 77  |ach field.ends w|
00001210  69 74 68 20 61 6e 20 65  6e 64 20 6f 66 20 66 69  |ith an end of fi|
00001220  65 6c 64 20 6d 61 72 6b  65 72 3b 20 65 61 63 68  |eld marker; each|
00001230  20 72 65 63 6f 72 64 20  65 6e 64 73 20 77 69 74  | record ends wit|
00001240  68 20 61 6e 20 65 6e 64  20 6f 66 20 72 65 63 6f  |h an end of reco|
00001250  72 64 0d 6d 61 72 6b 65  72 3b 20 61 6e 64 20 74  |rd.marker; and t|
00001260  68 65 20 66 69 6c 65 20  65 6e 64 73 20 77 69 74  |he file ends wit|
00001270  68 20 61 6e 20 65 6e 64  20 6f 66 20 66 69 6c 65  |h an end of file|
00001280  20 6d 61 72 6b 65 72 3b  20 61 66 74 65 72 20 74  | marker; after t|
00001290  68 65 20 65 6e 64 20 6f  66 20 66 69 6c 65 0d 6d  |he end of file.m|
000012a0  61 72 6b 65 72 2c 20 74  68 65 20 66 69 6c 65 20  |arker, the file |
000012b0  69 73 20 70 61 64 64 65  64 20 75 70 20 74 6f 20  |is padded up to |
000012c0  74 68 65 20 70 68 79 73  69 63 61 6c 20 65 6e 64  |the physical end|
000012d0  20 6f 66 20 66 69 6c 65  20 77 69 74 68 20 6e 75  | of file with nu|
000012e0  6c 6c 0d 63 68 61 72 61  63 74 65 72 73 2e 20 20  |ll.characters.  |
000012f0  49 66 20 79 6f 75 20 61  72 65 20 70 72 6f 63 65  |If you are proce|
00001300  73 73 69 6e 67 20 61 20  66 69 65 6c 64 27 73 20  |ssing a field's |
00001310  63 6f 6e 74 65 6e 74 73  2c 20 79 6f 75 20 73 68  |contents, you sh|
00001320  6f 75 6c 64 20 74 65 73  74 20 66 6f 72 0d 74 68  |ould test for.th|
00001330  65 20 65 6e 64 20 6f 66  20 66 69 65 6c 64 20 75  |e end of field u|
00001340  73 69 6e 67 20 74 68 65  20 43 48 4b 45 4f 46 20  |sing the CHKEOF |
00001350  61 6e 64 20 43 48 4b 45  4f 52 20 72 6f 75 74 69  |and CHKEOR routi|
00001360  6e 65 73 2e 20 20 54 68  65 73 65 20 72 6f 75 74  |nes.  These rout|
00001370  69 6e 65 73 20 73 65 74  0d 74 68 65 20 66 6c 61  |ines set.the fla|
00001380  67 73 20 61 63 63 6f 72  64 69 6e 67 20 74 6f 20  |gs according to |
00001390  74 68 65 20 63 68 61 72  61 63 74 65 72 20 74 68  |the character th|
000013a0  61 74 20 74 68 65 79 20  66 69 6e 64 2e 20 20 44  |at they find.  D|
000013b0  6f 6e 27 74 20 63 68 65  63 6b 20 66 6f 72 20 74  |on't check for t|
000013c0  68 65 0d 63 68 61 72 61  63 74 65 72 20 76 61 6c  |he.character val|
000013d0  75 65 20 65 78 70 6c 69  63 69 74 6c 79 2e 0d 0d  |ue explicitly...|
000013e0  47 65 6e 65 72 61 6c 6c  79 2c 20 77 68 65 6e 20  |Generally, when |
000013f0  79 6f 75 20 6d 61 6b 65  20 61 20 63 61 6c 6c 20  |you make a call |
00001400  74 6f 20 61 20 72 6f 75  74 69 6e 65 20 74 68 61  |to a routine tha|
00001410  74 20 6c 6f 63 61 74 65  73 20 61 20 66 69 65 6c  |t locates a fiel|
00001420  64 2c 20 74 68 65 20 78  0d 72 65 67 69 73 74 65  |d, the x.registe|
00001430  72 20 69 6e 64 69 63 61  74 65 73 20 77 68 65 72  |r indicates wher|
00001440  65 20 74 68 65 20 66 69  65 6c 64 20 69 73 20 74  |e the field is t|
00001450  6f 20 62 65 20 66 6f 75  6e 64 3a 0d 0d 20 20 20  |o be found:..   |
00001460  20 20 20 20 20 58 3d 30  20 20 20 20 20 20 20 20  |     X=0        |
00001470  20 20 20 20 20 46 69 65  6c 64 20 69 6e 20 68 65  |     Field in he|
00001480  61 64 65 72 3b 20 41 20  68 61 73 20 66 69 65 6c  |ader; A has fiel|
00001490  64 20 6e 75 6d 62 65 72  2e 0d 20 20 20 20 20 20  |d number..      |
000014a0  20 20 58 3d 31 20 74 6f  20 32 35 34 20 20 20 20  |  X=1 to 254    |
000014b0  20 20 46 69 65 6c 64 20  69 6e 20 66 6f 72 6d 61  |  Field in forma|
000014c0  74 20 66 69 6c 65 3b 20  58 20 67 69 76 65 73 20  |t file; X gives |
000014d0  66 6f 72 6d 61 74 20 66  69 6c 65 20 72 65 63 6f  |format file reco|
000014e0  72 64 0d 20 20 20 20 20  20 20 20 20 20 20 20 20  |rd.             |
000014f0  20 20 20 20 20 20 20 20  20 20 20 6e 75 6d 62 65  |           numbe|
00001500  72 3b 20 41 20 68 61 73  20 66 69 65 6c 64 20 6e  |r; A has field n|
00001510  75 6d 62 65 72 2e 20 20  54 68 65 20 66 69 65 6c  |umber.  The fiel|
00001520  64 20 6e 75 6d 62 65 72  73 20 6f 66 0d 20 20 20  |d numbers of.   |
00001530  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001540  20 20 20 20 20 74 68 65  20 76 61 72 69 6f 75 73  |     the various|
00001550  20 66 6f 72 6d 61 74 20  66 69 6c 65 20 66 69 65  | format file fie|
00001560  6c 64 73 20 61 72 65 20  73 75 6d 6d 61 72 69 73  |lds are summaris|
00001570  65 64 20 62 65 6c 6f 77  2e 0d 20 20 20 20 20 20  |ed below..      |
00001580  20 20 58 3d 32 32 35 20  20 20 20 20 20 20 20 20  |  X=225         |
00001590  20 20 46 69 65 6c 64 20  69 6e 20 63 75 72 72 65  |  Field in curre|
000015a0  6e 74 20 72 65 63 6f 72  64 3b 20 41 20 68 61 73  |nt record; A has|
000015b0  20 66 69 65 6c 64 20 6e  75 6d 62 65 72 3b 20 59  | field number; Y|
000015c0  20 68 61 73 0d 20 20 20  20 20 20 20 20 20 20 20  | has.           |
000015d0  20 20 20 20 20 20 20 20  20 20 20 20 20 72 65 63  |             rec|
000015e0  6f 72 64 20 6e 75 6d 62  65 72 2e 0d 0d 46 69 65  |ord number...Fie|
000015f0  6c 64 73 20 77 69 74 68  69 6e 20 61 20 72 65 63  |lds within a rec|
00001600  6f 72 64 20 61 72 65 20  6e 75 6d 62 65 72 65 64  |ord are numbered|
00001610  20 66 72 6f 6d 20 31 20  74 6f 20 32 35 34 2e 20  | from 1 to 254. |
00001620  20 49 66 20 79 6f 75 20  61 73 6b 20 66 6f 72 20  | If you ask for |
00001630  61 20 66 69 65 6c 64 0d  77 68 69 63 68 20 69 73  |a field.which is|
00001640  20 6e 6f 74 20 69 6e 20  74 68 65 20 72 65 63 6f  | not in the reco|
00001650  72 64 2c 20 74 68 65 20  72 6f 75 74 69 6e 65 20  |rd, the routine |
00001660  77 69 6c 6c 20 72 65 74  75 72 6e 20 77 69 74 68  |will return with|
00001670  20 74 68 65 20 43 61 72  72 79 20 66 6c 61 67 20  | the Carry flag |
00001680  73 65 74 2e 20 0d 57 68  65 72 65 61 73 20 56 69  |set. .Whereas Vi|
00001690  65 77 53 74 6f 72 65 20  6b 6e 6f 77 73 20 77 68  |ewStore knows wh|
000016a0  65 72 65 20 74 68 65 20  66 6f 72 6d 61 74 20 66  |ere the format f|
000016b0  69 6c 65 20 69 73 20 6c  6f 63 61 74 65 64 2c 20  |ile is located, |
000016c0  74 68 65 20 61 64 64 72  65 73 73 20 6f 66 20 74  |the address of t|
000016d0  68 65 0d 63 75 72 72 65  6e 74 20 72 65 63 6f 72  |he.current recor|
000016e0  64 20 63 6f 75 6c 64 20  62 65 20 61 6e 79 77 68  |d could be anywh|
000016f0  65 72 65 2c 20 61 6e 64  20 62 65 66 6f 72 65 20  |ere, and before |
00001700  66 69 65 6c 64 73 20 77  69 74 68 69 6e 20 74 68  |fields within th|
00001710  65 20 63 75 72 72 65 6e  74 0d 72 65 63 6f 72 64  |e current.record|
00001720  20 63 61 6e 20 62 65 20  61 63 63 65 73 73 65 64  | can be accessed|
00001730  2c 20 79 6f 75 20 6d 75  73 74 20 74 65 6c 6c 20  |, you must tell |
00001740  56 69 65 77 53 74 6f 72  65 20 69 74 73 20 61 64  |ViewStore its ad|
00001750  64 72 65 73 73 20 77 69  74 68 20 74 68 65 20 53  |dress with the S|
00001760  45 54 44 50 53 0d 72 6f  75 74 69 6e 65 2e 0d 0d  |ETDPS.routine...|
00001770
F/+HINT7.m0
F/+HINT7.m1
F/+HINT7.m2
F/+HINT7.m4
F/+HINT7.m5