Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One response when I debug and other in runtime
Message
De
02/03/2006 05:29:51
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
One response when I debug and other in runtime
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01100771
Message ID:
01100771
Vues:
56
Hello,

I'm trying to send SMS in VFP, and i need the Mscomm ActiveX control to do that.

The code i'm using is following:
thisform.oCom.Output = "AT" + Chr(13) + Chr(10)
thisform.ocom.Refresh 
time = seconds()
do while .t.
	ReturnString = thisform.oCom.input 
	if at("OK", upper(ReturnString)) > 0
		exit
	endif
	if seconds() > time + 5
		exit
	endif
enddo
?? ReturnString
The above code do this:
1) First i send a command to the Phone with 'output' method of the ActiveX
2) Then i wait 5 seconds for a response from the phone (with the 'input' method), that should be something like this: "AT" + chr(13) + chr(10) + "OK" + chr(13)
3) The loop is breaked in 2 ways: the 5 seconds pass away or i get the word 'OK' in the return string from the phone

But i get a "strange" behaviour:
When i'm debuging this code to see what is wrong, the code works fine and i receive the correct string. When i'm running this code normally i get nothing.

Does anyone know why?

Thank you,
Joaquim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform