Yes, I have another use of 'End' in mind.
I'll try to give better examples of what I mean.
This code works fine in PB and SB as well:
Code: Select all
If OpenWindow(0, 100, 200, 320, 200, "Test", #PB_Window_TitleBar)
If CreateImage(0, 320, 200)
If StartDrawing(ImageOutput(0))
; [...]
Else
Debug "Can't start drawing."
EndIf
Else
Debug "Can't create image."
EndIf
; [...]
Else
Debug "Can't open window."
EndIf
Depending on the actual code, sometimes I prefer to write the same stuff in a different way.
The following code is logically equivalent to the first one, but runs only in PB:
Code: Select all
If OpenWindow(0, 100, 200, 320, 200, "Test", #PB_Window_TitleBar) = 0
Debug "Can't open window."
End
EndIf
If CreateImage(0, 320, 200) = 0
Debug "Can't create image."
End
EndIf
If StartDrawing(ImageOutput(0)) = 0
Debug "Can't start drawing."
End
EndIf
; [...]
; [...]
When I want to run that program in SB, I have to rewrite the code.
I would greatly appreciate it if that code would run in SB, too -- if possible.
I'm aware that I can write it in SB (and PB) like this:
Code: Select all
Procedure Main()
If OpenWindow(0, 100, 200, 320, 200, "Test", #PB_Window_TitleBar) = 0
Debug "Can't open window."
ProcedureReturn
EndIf
If CreateImage(0, 320, 200) = 0
Debug "Can't create image."
ProcedureReturn
EndIf
If StartDrawing(ImageOutput(0)) = 0
Debug "Can't start drawing."
ProcedureReturn
EndIf
; [...]
; [...]
EndProcedure
Main()
But that would also mean rewriting the original PB code.