We're going to take a few days and test with the sleep in there for the first issue.
That's just it TheEndless - it'll work without the print statement 95% of the time or so, some roku's never exhibit the problem, but some do. So I end up always printing the result to cover all cases.
😞The code is really basic IMO.
m.text=EnterText()
Print m.text
If m.text="msg.isScreenClosed()" End
Function EnterText() As String
textscreen=CreateObject("roKeyboardScreen")
port=CreateObject("roMessagePort")
textscreen.SetMessagePort(port)
textscreen.SetDisplayText("Enter text")
textscreen.SetMaxLength(100)
textscreen.AddButton(1,"Finished")
textscreen.AddButton(2,"Cancel")
textscreen.Show()
While TRUE
msg=Wait(0,port)
If Type(msg)="roKeyboardScreenEvent"
If msg.isScreenClosed()
Return "msg.isScreenClosed()"
Else If msg.isButtonPressed()
If msg.GetIndex()=1
textentry=textscreen.GetText().Trim()
Print textentry
If len(textentry)>0 Exit While
End If
If msg.GetIndex()=2
Return "msg.isScreenClosed()"
End If
End If
End If
End While
Return textentry
End Function
Also sometime simply retrieving a value from the roku registry lags out, so the next instruction sees 'invalid' - so I need to print the result after each registry read too. As long as the prints are in place after each, it resolves fine.