This is the shortest code I’ve been able to get to duplicate the issue.
Sub Main()
u = getStringFromKeyboard("Enter username")
p = getStringFromKeyboard("Enter password")
End Sub
Function getStringFromKeyboard(message = "" As String) As String
result = ""
port = CreateObject("roMessagePort")
screen = CreateObject("roKeyboardScreen")
screen.SetMessagePort(port)
screen.SetDisplayText(message)
screen.AddButton(1, "OK")
screen.Show()
while true
print "waiting..."
msg = wait(0, port)
print "done waiting"
if type(msg) = "roKeyboardScreenEvent" then
if msg.GetIndex() = 1 then
result = screen.GetText()
exit while
end if
end if
end while
screen.Close()
return result
End Function
Running this app, I get prompted for a username, I enter the username and hit ok, then I get booted back to the main menu. The second keyboard screen (for the password) never appears. The debug output shows:
waiting...
done waiting
waiting...
I.e., it’s crashing on the second call to wait(). Am I doing something wrong or is this a platform bug?
