home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / ref / ba01i.do < prev    next >
Text File  |  2006-10-19  |  4KB  |  132 lines

  1.  
  2.  Title: SERIAL PORT (COM)
  3.  
  4.  
  5. Some BASIC commands require that you signify the communications configuration. 
  6. It consists of a five character string of the pattern (rwpbs): 
  7.  
  8.  r - Baud Rate: This is a number from 1 to 9, where 1=75; 2=110; 3=300; 4=600; 
  9.                 5=1200; 6=2400; 7=4800; 8=9600; 9=19200. 
  10.  
  11.  w - Word Length: This is a number from 6 to 8, where 6=6bits; 7=7bits; 
  12.                   8=8bits. 
  13.  
  14.  p - Parity: either E,O,I, or N, where E=even; O=odd; I=ignore; N=none
  15.  
  16.  b - Stop Bits: Either 1 or 2, where 1=1 stop bit; 2=2stop bit.
  17.  
  18.  s - Xon/Xoff Status: Either E or D, where E=enable; D=disable 
  19.  
  20.  
  21. COMONorOFForSTOP
  22.  Enables or disables the ONCOM interrupt.
  23.  
  24. CLOSEfilenumberlist
  25.  Closes the files OPEN'ed as filenumber. 
  26.  
  27.  
  28. EOF(filenumber)
  29.  Tests for an end-of-file condition on the communications file OPEN'ed as 
  30.  filenumber.  The function returns a "logical" answer, either "true" (-1) if 
  31.  you have reached the end of the file, or else "false" (0) if you have not 
  32.  reached the end of the file. 
  33.  
  34.  
  35. INPUT#filenumber,variablelist
  36.  Inputs data sequentially from the communications file OPEN'ed as filenumber. 
  37.  
  38.  
  39. INPUT$(numericexpression,filenumber)
  40.  Returns a string of a length given by numericexpression from the 
  41.  communications file OPEN'ed as filenumber. 
  42.  
  43.  
  44. LOAD"COM:filename",R
  45.  Loads a BASIC program from the communications port.  If R is present, BASIC 
  46.  runs the program after it has been loaded. 
  47.  
  48.  
  49. MAXFILES
  50.  Stores the current maximum number of files.  You may access MAXFILES line any 
  51.  numeric variable. 
  52.  
  53.  
  54. MERGE"COM:filename"
  55.  Merges the lines from the incoming file with the lines of the current 
  56.  program. 
  57.  
  58.  
  59. ONCOMGOSUBlinenumber
  60.  Defines a communications interrupt subroutine for incoming communications.
  61.  
  62.  
  63. OPEN"COM:filename"FORmodeASfilenumber
  64.  Allocates a buffer, filenumber, for a communications file called filename.  
  65.  Mode can be OUTPUT, specifying data will be transmitted out the 
  66.  communications port, or INPUT, specifying data will be received from the 
  67.  communications port. 
  68.  
  69.  
  70. PRINT#filenumber,expressionlist
  71.  Writes the values of expressionlist to the communications file OPEN'ed as 
  72.  filenumber. 
  73.  
  74.  
  75. PRINT#filenumber,USING"format";expressionlist
  76.  Formats the data in expressionlist and sends it to the communications port 
  77.  file OPEN'ed as filenumber.  Format consists of one of more of the following 
  78.  "field specifiers": 
  79.  
  80. Prints first string character.
  81.  PRINT#1,USING"!";"Tandy"
  82.  
  83. Prints 2+n characters from a string.
  84.  PRINT#1,USING"\\";"Tandy"
  85.  
  86. Print one digit for each #.
  87.  PRINT#1,USING"#####";5
  88.  
  89. Inserts the algebraic sign of the number.
  90.  PRINT#1,USING"+####";-13
  91.  
  92. Inserts a minus sign either at the beginning or end of negative numbers.  
  93.  PRINT#1,USING"-####";14 
  94.  
  95. Converts leading blanks to leading asterisk blanks.
  96.  PRINT#1,USING"**#####";145 
  97.  
  98. Inserts a dollar sign to the immediate left of the formatted number.  
  99.  PRINT#1,USING"$$#####";450 
  100.  
  101. Changes leading spaces to asterisks except for the space to the immediate left 
  102. of the number, where is inserts a dollar sign. 
  103.  PRINT#1,USING"**$###";12 
  104.  
  105. Inserts a decimal point.
  106.  PRINT#1,USING"#####.##";14.5
  107.  
  108. Inserts a comma before every three printed digits to the left of the decimal 
  109. point. 
  110.  PRINT#1,USING"#########,";14432
  111.  
  112. Prints the number in exponential format.
  113.  PRINT#1,USING"###.##^^^^";342200 
  114.  
  115.  
  116. RUN"COM:filename",R
  117.  Clears all variables, loads the BASIC program called filename from the 
  118.  communications port, and then executes the program.  If R is present, BASIC 
  119.  keeps all open files open.  If R is omitted, BASIC closes all open file 
  120.  before loading filename. 
  121.  
  122.  
  123. SAVE:COM:filename",A
  124.  Writes the current BASIC program out the communications port in ASCII format. 
  125.  
  126.  
  127. TAB(numericexpression)
  128.  Writes numericexpression spaces before writing the next data item.  
  129.  Numericexpression spaces between 0 and 255. 
  130.  
  131. <EOF>
  132.