Amos Professional Manual  Contents  Index

Disc Access


SET INPUT
instruction: set end-of-line characters
Set Input code1,code2

SET INPUT is used to set which characters you want to input to end a line of data. Many computers need both a [Return] and [line feed] character at the end of each line, but the Amiga only needs a [line feed]. This means that if you wanted to import files from an ST via the serial cable, for example, unwanted [Return] characters would litter your input.

SET INPUT solves this problem by allowing you to select two Ascii values as your end-of-line characters. If you prefer to use a single character only, make the second value a negative number. For example:

X> Set Input 10,-1 : Rem Standard Amiga format
   Set Input 13,10: Rem ST compatible format

INPUT$
function: input a fixed number of characters from a device
i$=Input$(file,count)

Use this function to input a set number of characters from a device or file. The parameters in brackets refer to the filename or device, followed by the count of characters to be input.

EOF
function: test for end of file
flag=Eof(channel)

This tests to see if the end of a file has been reached at the current reading position, returning -1 for yes and 0 if this has not happened.

LOF
function: give length of an open file
length=Lof(channel)

LOF returns the length of an open file, and it would be pointless to use this function with devices other than the current disc.

POF
reserved variable: hold current position of file pointer
position=Pof(channel)

This changes the current reading or writing position of an open file. For example, the following line sets the read/write position to 1,000 characters past the start of the file:

X> Pof(1)=1000

Because disc drives are inherently random, this may be used to provide a crude form of random access with sequential files.

Back    Next
10.02.13