Liberty BASIC Community Forum
« Continue »

Welcome Guest. Please Login or Register.
Feb 22nd, 2018, 05:07am

Rules|Home|Help|Search|Recent Posts|Notification

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Continue  (Read 166 times)
Global Moderator

member is offline


Graphics = goosebumps!


Gender: Male
Posts: 5663
xx Continue
« Thread started on: Jan 10th, 2018, 3:01pm »

There is a thread on the Yahoo forum which I have been trying to reply to for days. I give up. They seem to want to skip loop code if x =2 or 5 so what’s wrong with if x<>2 and x<>5?
User IP Logged

Board Moderator

member is offline


Anatoly (real name)


Gender: Male
Posts: 1745
xx Re: Continue
« Reply #1 on: Jan 10th, 2018, 3:41pm »

They seem to want to skip loop code if x =2 or 5 so what’s wrong with if x<>2 and x<>5?

It's not "wrong"
They just used to have special operator - C-like CONTINUE.
Me got taught about it, too
so if I need it I just use GOTO
for i = 1 to 100
... some code
if needsContinue then [continue]
... some more code

could actually lead to "wrong" indeed:
stacking several conditions
* either got one humongous super-condition - impossible to read and debug
* or brings extra layers of indented code, which just pain to watch.

(EDIT2 actually, thats "code complete" slowly reappearing in my head. Likely that was said about nested IF's , like may be here, but I think it still apply. )

That is, you you really need that much conditions ;)

nice one
User Image
« Last Edit: Jan 10th, 2018, 3:57pm by tsh73 » User IP Logged

damned Dog in the Manger
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls