I've run into a strange problem, I hope someone has an answer!
The code is rather lengthy, so please forgive my use of pseudo code.
Presume all standard modules which all work just fine - VR1, TTS1, Timer_Tick, S1 to return bFinished from PhoneEvents, etc.
If I perform this:
Sub Globals
Dim Asking as Boolean=False
<dim everything else, no errors>
Sub Say(ALine as String)
Timer.Enabled=True
TTS1.Speak(ALine,False)
End Sub
'
Sub Timer_Tick
If bfinished=TrueThen
<do a bunch of stuff>
If Asking Then VR1.Listen
End If
End Sub
Sub VR1_Result (Success as Boolean, Texts as List)
If Success=False Then Return
<do something with the texts>
Dim YourResponse As String=Texts.Get(0)
The following code works just fine:
Sub Foo
Asking=True
Say("Something or another")
<your response is returned correctly as a string>
End Sub
Tracing everything in the log, I see subroutine SAY enable the timer; I see the timer fire until bfinished=True, I see the proper code returned.
The problem is this:
Sub Wow
For i=0 to 10
Say("The value for i is " & i)
Asking=True
Say("Say something")
<if your response = x then y>
Next
End Sub
In this case, the log shows 10 "The value for i is" messages, the timer never fires, and the responses are all evaluated as if they returned null.
It's as though the code is more concerned with the for/next loop than the timer firing and conditionally ending.
I've tried putting in Do While loops in Sub Wow to give the timer time to fire (it's initialized at 500ms) but the for/next loop ignores the timer entirely.
Anyone else run into this, or am I doing something completely wrong?
Thanks!
:sign0085: