Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One response when I debug and other in runtime
Message
 
To
02/03/2006 05:29:51
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01100771
Message ID:
01100774
Views:
14
Maybe 5 seconds are not enough to get responce, when you debug you break the program and time for waiting is increased a little. Also try to put DOEVENTS in that loop.
do while .t.
   ReturnString = thisform.oCom.input
   if at("OK", upper(ReturnString)) > 0
      exit
   endif
   if seconds() > time + 5
      exit
   endif
   DOEVENTS &&[FORCE]
enddo
>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
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform