How to loop comm port control to read text files through serial port in VB3 
Author Message
 How to loop comm port control to read text files through serial port in VB3

I am trying to read a text file in throught the serial port
using the communication control that comes with VB3.  I am
using the line

Print #1, frmScan.Comm1.Input;

to print the file to a text file on the c: drive.  The problem
I seem to be having is looping this line to continue printing
the receive buffer to the output file #1.  If I don't loop
it reads the 1024 buffer and then quits.  I have tried looping
till the property comm1.inbuffercount = 0 but then it exits
as soon as the buffer empties which is about after 4
charactors
or 32 bytes.  Has anyone used this control that could send
me a sample code.  The text file will vary in size so I
can not do it a fixed number of times, like with a for loop.

Help please.

Thanks

Dorian Jessick



Sat, 10 Oct 1998 03:00:00 GMT  
 How to loop comm port control to read text files through serial port in VB3

Quote:
>The problem
>I seem to be having is looping this line to continue printing
>the receive buffer to the output file #1.

If you use Chr$(13) as the End Of Line marker, this code will semi-work:

t$ = frm!com.Input
Do
        Print #1, t$
        t$ = frm!com.Input
        DoEvents
Loop While Instr(t$, Chr$(13)) = 0


--
Real programmers never work 9 to 5. If any Real Programmers are
around at 9:30 AM, it's because they were up all night.

http://www.sn.no/~balchen/
ftp://ftp.sn.no/user/balchen/



Sat, 10 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Comm Overrun when playing sound while reading serial port (VB4.0)

2. I/O port, Parallel port, Serial port

3. Getting Data from Serial Port using Comm Control

4. Getting Data from Serial Port using Comm Control

5. Getting Data from Serial Port using Comm Control

6. serial port and comm control

7. Need help on reading text in serial port

8. Read Comm port information from Control Panel

9. Parellel & Serial ports, help files in VB3

10. VB3 Serial Port Control without MSCOMM.VBX

11. Serial Comm Port 8-bit + parity?

12. I need testers for serial port comm DLL and alpha paging DLL (Delphi, C/C++, VB)

 

 
Powered by phpBB® Forum Software