Amos Professional Manual  Contents  Index

Disc Access


You can now place some records in the strings that have been set up by the FIELD command, like this:

X> SURNAME$="Professional"
   FIRSTNAME$="AMOS"
   TEL$="0625859333"

PUT
instruction: output a record to a random access file
Put channel,record number

Once a record has been placed in a string, it can be moved from the computer's memory into a record number of your random access file. If you were still using channel 1, your first record would be put into the random access file like this:

X> Put 1,1

The next record will become number 2, and so on until you fill up your telephone book. Here is a simple working example. When you have created enough records, type in "exit" when prompted to enter another name.

E> Open Random 1,"ADDRESS"
   Field 1,25 As NAME$,12 As TEL$
   INDEX=1
   Do
    Input "Enter a name:";NAME$
    If NAME$="exit" Then Exit
    Input "Enter the phone number:";TEL$
    Put 1,INDEX
    Inc INDEX
   Loop
   Close 1

Having created your phone book, you will want to use it.

GET
instruction: read a record from a random access file
Get channel,record number

This instruction reads a record stored in a random access file, after being told which channel to use and the number of the record to read. To read the first record you would use this:

X> Get 1,1

GET then loads this record into your field strings, and these strings may be manipulated as you like. Obviously you can only GET record numbers that have been PUT onto the disc.

Back    Next
10.02.15