Breaking loops

Just starting out? Need help? Post your questions and find answers here.
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 Justin.

Since PB does not have a break or continue command i use gotos to exit loops, it does not crash, but it is legal to do it in PB?

ex:

repeat
.
if x=y then goto skip
.
.
until ...
skip:

same with for/next, i need to do it because i don't want to process the functions under the if.
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 Franco.

AFAIK it's legal to use it, but YOU have to know what you are doing!

Side note:
PureBasic doesn't recognize THEN as shown in your example...


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
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 Justin.

Thank you, i was concerned about breaking some rule.
Side note:
PureBasic doesn't recognize THEN as shown in your example...
i'm using too many different languages, i suppose...
Post Reply