I notice that the Or operator is shortcutted.
That is, if the first condition is True then the second condition is not evaluated.
This allows the use of the 'Do or Die' idiom common in Perl and PHP.
That is instead of writing
Code: Select all
Procedure Die(Message.s)
MessageRequester("Fatal Error", Message)
End
EndProcedure
Enumeration ;Windows
#MainWindow
EndEnumeration
#MainWindowFlags = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered
If OpenWindow(#MainWindow,0,0, 500, 500, #MainWindowFlags, "Window") = 0
Die("Unable to Open Main Window")
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Code: Select all
Procedure Die(Message.s)
MessageRequester("Fatal Error", Message)
End
EndProcedure
Enumeration ;Windows
#MainWindow
EndEnumeration
#MainWindowFlags = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered
Bool(OpenWindow(#MainWindow,0,0, 500, 500, "Window", #MainWindowFlags) Or Die("Unable to Open Main Window"))
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow