>I want to write some data to a datacard machine through communication port,
>I use function FOPEN to open the port
> FOPEN("COM1", 12)
>however, it always returns the value -1. And I can't find any other
>information about
>the communication port in the help file.
>My questions are how to open a COM port in VFP 5 and how to write data to
>it.
>
>Thanks !
You cannot write to the comm port in this fashion. (In Fox Dos.. this was a way.)
Instead you have to use the mscomm control.
Basically you place the ole object (mscomm.ocx) on your form.
It has properties for setting the port, etc.
Once the comm parameters are set and the port has openned successfully, you send strings out of the port via its output property.
i.e.
If the name of the control is mycomm
then
mycomm.output='HI' will send Hi out the comm port you set in your setup.
See the VFP help file under OLE controls and MSComm for more info.
Mike
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only