Function ShowMessageBox( title As String, message As String, buttons = [ "OK" ] )
messageBox = CreateObject( "roMessageDialog" )
messageBox.SetMessagePort( CreateObject( "roMessagePort" ) )
messageBox.SetTitle( title )
messageBox.SetText( message )
For buttonIndex = 0 To buttons.Count() - 1
messageBox.AddButton( buttonIndex, buttons[ buttonIndex ] )
Next
messageBox.Show()
While True
msg = wait( 0, messageBox.GetMessagePort() )
If msg <> invalid Then
If Type( msg ) = "roMessageDialogEvent" Then
If msg.IsButtonPressed() Then
Return buttons[ msg.GetIndex() ]
End If
End If
End If
End While
End Function
result = ShowMessageBox("Confirm", "Are you sure you want to blah blah blah?", [ "Yes", "No" ])
If result = "Yes" Then
'Do that thing...
End If
if msg.index() = 4
<code you gave me>
end if
*** ERROR compiling /pkg:/source/appDetailScreen.brs:
line 104, error code &h02: Syntax Error
line 123, error code &h02: Syntax Error
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
We're sorry for this disruption — we’re excited to share what’s next!