home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
club100
/
ref
/
ba01i.do
< prev
next >
Wrap
Text File
|
2006-10-19
|
4KB
|
132 lines
Title: SERIAL PORT (COM)
Some BASIC commands require that you signify the communications configuration.
It consists of a five character string of the pattern (rwpbs):
r - Baud Rate: This is a number from 1 to 9, where 1=75; 2=110; 3=300; 4=600;
5=1200; 6=2400; 7=4800; 8=9600; 9=19200.
w - Word Length: This is a number from 6 to 8, where 6=6bits; 7=7bits;
8=8bits.
p - Parity: either E,O,I, or N, where E=even; O=odd; I=ignore; N=none
b - Stop Bits: Either 1 or 2, where 1=1 stop bit; 2=2stop bit.
s - Xon/Xoff Status: Either E or D, where E=enable; D=disable
COMONorOFForSTOP
Enables or disables the ONCOM interrupt.
CLOSEfilenumberlist
Closes the files OPEN'ed as filenumber.
EOF(filenumber)
Tests for an end-of-file condition on the communications file OPEN'ed as
filenumber. The function returns a "logical" answer, either "true" (-1) if
you have reached the end of the file, or else "false" (0) if you have not
reached the end of the file.
INPUT#filenumber,variablelist
Inputs data sequentially from the communications file OPEN'ed as filenumber.
INPUT$(numericexpression,filenumber)
Returns a string of a length given by numericexpression from the
communications file OPEN'ed as filenumber.
LOAD"COM:filename",R
Loads a BASIC program from the communications port. If R is present, BASIC
runs the program after it has been loaded.
MAXFILES
Stores the current maximum number of files. You may access MAXFILES line any
numeric variable.
MERGE"COM:filename"
Merges the lines from the incoming file with the lines of the current
program.
ONCOMGOSUBlinenumber
Defines a communications interrupt subroutine for incoming communications.
OPEN"COM:filename"FORmodeASfilenumber
Allocates a buffer, filenumber, for a communications file called filename.
Mode can be OUTPUT, specifying data will be transmitted out the
communications port, or INPUT, specifying data will be received from the
communications port.
PRINT#filenumber,expressionlist
Writes the values of expressionlist to the communications file OPEN'ed as
filenumber.
PRINT#filenumber,USING"format";expressionlist
Formats the data in expressionlist and sends it to the communications port
file OPEN'ed as filenumber. Format consists of one of more of the following
"field specifiers":
Prints first string character.
PRINT#1,USING"!";"Tandy"
Prints 2+n characters from a string.
PRINT#1,USING"\\";"Tandy"
Print one digit for each #.
PRINT#1,USING"#####";5
Inserts the algebraic sign of the number.
PRINT#1,USING"+####";-13
Inserts a minus sign either at the beginning or end of negative numbers.
PRINT#1,USING"-####";14
Converts leading blanks to leading asterisk blanks.
PRINT#1,USING"**#####";145
Inserts a dollar sign to the immediate left of the formatted number.
PRINT#1,USING"$$#####";450
Changes leading spaces to asterisks except for the space to the immediate left
of the number, where is inserts a dollar sign.
PRINT#1,USING"**$###";12
Inserts a decimal point.
PRINT#1,USING"#####.##";14.5
Inserts a comma before every three printed digits to the left of the decimal
point.
PRINT#1,USING"#########,";14432
Prints the number in exponential format.
PRINT#1,USING"###.##^^^^";342200
RUN"COM:filename",R
Clears all variables, loads the BASIC program called filename from the
communications port, and then executes the program. If R is present, BASIC
keeps all open files open. If R is omitted, BASIC closes all open file
before loading filename.
SAVE:COM:filename",A
Writes the current BASIC program out the communications port in ASCII format.
TAB(numericexpression)
Writes numericexpression spaces before writing the next data item.
Numericexpression spaces between 0 and 255.
<EOF>