The following example script creates the four buttons on the screen: Digits, State, Play Screen, and Done. The Digits and State buttons allow the user to input a verbal response which is then displayed on the screen. The Play Screen button causes the mobile device to read back all the text on the screen, and the Done button allows the user to exit the script.
While_Not(bExit)
If_Not(bButtonsVisible)
Button_Create_View(“Digits”,999,1,6,bGetDigits)
Button_Create_View(“State”,999,16,5,bGetState)
Button_Create_View(“PlayScreen”,1000,1,11,bPlayScreen)
Button_Create_View(“Done”,1000,13,4,bExit)
End_If
Wait_For_Screen_Update
If(bPlayScreen)
bPlayScreen=FALSE
Button_Remove_All
bButtonsVisible=FALSE
Delay(1)
nNumRows=Get_Screen_Rows
nCurrentRow=1
While(Number_Less_Than_Or_Equal
(nCurrentRow,nNumRows))
Speech_From_Text(Get_Screen_Text(nCurrentRow,1),FALSE)
nCurrentRow=Number_Plus(nCurrentRow,1)
End_While
End_If
If(bGetDigits)
bGetDigits=FALSE
Button_Remove_All
bButtonsVisible=FALSE
Message(“Say 1 or more digits...”,0)
szResult=””
Speech_To_Text(szResult,”connected_digits”)
Message_Clear
szResult=String_Strip_Characters(szResult,””,FALSE)
Keypress_String(szResult)
End_If
If(bGetState)
bGetState=FALSE
Button_Remove_All
bButtonsVisible=FALSE
Message(“Say a USA state...”,0)
szResult=””
Speech_To_Text(szResult,”usa_states”)
Message_Clear
Keypress_String(szResult)
End_If
End_While
Button_Remove_All
Return
Was this article useful?
The topic was:
Inaccurate
Incomplete
Not what I expected
Other