
Read data from a serial port
Quote:
>I'm trying to read a text file from a serial port, actually from a hand
>held device that connects to my serial port. The unit has a dos program
>that reads the data, but its very clumsy to "shell" to the dos program.
The method used by Qbasic still works in VB3. Look at OPEN COM in
Qbasic Help. Here is a typical program:
OPEN "COM1:9600" for input as #1
B$=""
DO UNTIL B$ = something useful
B$ = B$ + INPUT$(1,1)
LOOP
Quote:
>I have a copy of IO.VBX and VBIO.VBX (I think those are the two that I've
>run across) but I'm not sure how to address the port.
You don't need these.
By the way, when you say it is very clumsy to shell to the DOS program,
what do you mean exactly? If you mean the replacement of the desktop by
a full DOS screen you can get around that, and run the DOS program
minimised by using a PIF with "Windowed" checked.
If you mean the DOS program doesn't terminate itself when it has
finished then you are right; and it is more than clumsy, it is unusable.
--
Peter Hesketh