Page 1 of 1

[Implemented] EXIT DO ; ERROR TRAPING

Posted: Thu Feb 07, 2002 1:35 pm
by BackupUser
Restored from previous forum. Originally posted by gnozal.

What I REALLY miss : EXIT DO (eg: EXIT REPEAT, EXIT WHILE)

********** ALL BASIC's **************
DO
' Want to exit
EXIT DO
'
LOOP
********** PUREBASIC **************
REPEAT
' Want to exit
Quit = 1
'
UNTIL Quit = 1
************************************

What I also miss : ON ERROR GOTO, ERRLINE, ERRNUM, ...
Why not add error traping? It could be optional for those who want speed..

Posted: Thu Feb 07, 2002 5:43 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> What I REALLY miss : EXIT DO (eg: EXIT REPEAT, EXIT WHILE)

You can currently exit a loop in a manner like this:

Code: Select all

OpenConsole()
a=136
For r=1 To 1000
  PrintN(Str(r))
  If r=a : r=1000 : EndIf ; r=1000 is equivalent of "exit".
Next
MessageRequester("info","loop exited because r=136",0)
> Why not add error traping?

FakeFactory published a good generic error handler which stops your app
crashing, at this URL:

viewtopic.php?t=630

Both of these are not exactly what you wanted, but they're a start until Fred
can implement your wishes.

PB - Registered PureBasic Coder