rsread.wbb - Read a Record by way of an RS-232 Serial Connection (UNIX only)

Syntax

CALL "rsread.wbb",filename$,mode$,ky$,knum,rec$,errmsg$

Description

This program communicates with a running "rswatch.wbb" task on another system. It scans the file for an available port to issue a request on. Each serial port has a corresponding "rswatch" task running on the target system. A library of available serial ports is maintained in the text file "rsttys.txt"

By using a dedicated serial connection between a live Business BASIC system and a Web server system connected to the Internet, potential security issues of having a TCP/IP connection to the live system can be avoided. While a dedicated serial connection is slower and doesn't support concurrency, it is secure.

Parameter

Description

filename$

Name of the file on the target system to access. It can be a full pathname, or any name accessible to the task running rswatch.wbb on the target system.

mode$

Read mode used to access the desired record:

  • n retrieves the key after that specified in ky$ (ky$ need not exist).

  • p retrieves the key before that specified in ky$ (ky$ need not exist).

  • any other value looks for ky$ specifically.

ky$

Key to access, or a positioning value for the "n" and "p" modes. This returns the actual key of the record returned.

knum

Key chain number to use in a multi-keyed file. If the keys are not unique, the use of ky$ for repeated requests may return the same record. It may be necessary to use the "rsreadm.wbb" program to get a range of duplicate secondary keys.

rec$

Returns the data record, with trailing $00$ (hex 00) values removed.

errmsg$

Returns an error message if an error occurs. An "Error 2" detects an end-of-file condition when using modes "n" and "p".