OnErrorGosub() renamed to OnErrorProcedure()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

OnErrorGosub() renamed to OnErrorProcedure()

Post by Kale »

Pretty self explanitory really, IMHO OnErrorGosub() should be renamed to OnErrorProcedure() because you pass it the address of a procedure not a label as you would during a Gosub call. :P
--Kale

Image
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

think again about it :)

Code: Select all

OnErrorGosub(?Errorhandler)

MessageRequester("Info","Before the error",0)
b=0
t=2/b
MessageRequester("Info","okay ?",0)

End

Errorhandler:
MessageRequester("Info","Error Stop",0)
Return
SPAMINATOR NR.1
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Rings wrote:think again about it :)

Code: Select all

OnErrorGosub(?Errorhandler)

MessageRequester("Info","Before the error",0)
b=0
t=2/b
MessageRequester("Info","okay ?",0)

End

Errorhandler:
MessageRequester("Info","Error Stop",0)
Return
I see, so it can handle both? Why have the OnErrorGoto command then? :wink:
--Kale

Image
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Aha! Let me guess! You can't return from a OnErrorGoto command then?
--Kale

Image
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

bingo!
SPAMINATOR NR.1
Post Reply