[Implemented] EXIT DO ; ERROR TRAPING

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] EXIT DO ; ERROR TRAPING

Post 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..
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
Post Reply