Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Write String to COM Port
Message
De
01/11/2004 00:56:04
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Divers
Thread ID:
00955494
Message ID:
00956444
Vues:
12
>I need to write directly to a Com port... what have you done/used that was successful?
Here's what I do


Function Write2ComPort
Lparameters tcComPort, tcString
* PASS the COMPORT and the string to send to it
* eg "COM1:","ABCDEF"
#Define ForReading 1
#Define ForWriting 2
oWshFile = CREATEOBJECT("Scripting.FileSystemObject")
If TYPE("oWshFile") #"O"
Return .F.
Endif
oCom = oWshFile.OpenTextFile(tcComPort, ForWriting, .T.)
oCom.Write(tcString)
oCom.Close
Release oCom
Release oWshFile
Return

HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform