Re: BBC BASIC (V 1.29) and IF Statments



In message <2aFXh.65$en5.44@xxxxxxxxxxxxxxxxxxxx>
Michael Emerton <MichaelREmerton@xxxxxxxxxxxxxxxxxxxxx>
wrote:

IF direction% = 0
direction% = 1
PRINT STR$(direction%)
ELSE
direction% = 0
PRINT STR$(direction%)
ENDIF

However (If anyone notices ;@)) There is a "THEN" Missing.

Yes. If my memory serves correctly, this gets parsed as meaning:

IF direction% <> 0 THEN = 0

No.

Which means "If direction is non-zero, return from function returning
zero" which is obviously not what you want. Always use the THEN.

oooo, useful to note that!

No, better not note that explanation because it is wrong (of course,
the recommendation to always use the THEN is right). The above is
parsed as meaning:
IF direction% = 0 THEN REM do nothing
There is definitely no function return involved. If it was you would
have seen a "Not in a function" error unless the above code happened
to be inside a function.

Martin
--
---------------------------------------------------------------------
Martin Wuerthner MW Software http://www.mw-software.com/
ArtWorks 2 -- Designing stunning graphics has never been easier
spamtrap@xxxxxxxxxxxxxxx [replace "spamtrap" by "info" to reply]
.



Relevant Pages

  • Re: Distinguish "Once" from "One time"
    ... in language and points to assignment of meaning other ... I am twice absent minded, ... Our "once" is missing a letter and is special, ... is "colonel" is missing a letter and is special. ...
    (alt.usage.english)
  • Re: dasnt take it up
    ... Unless I'm missing some posts, I don't think anyone has commented ... specifically on the meaning of "take it up", ... "accept a challenge" which I am familiar with is in card games of the ...
    (alt.usage.english)
  • Re: IDSA Guidelines...can anyone tell me what this means?
    ... "You simply are incorrect and your read of the material is missing the ... of the meaning that is spelled out in detail in the body of the text". ...
    (sci.med.diseases.lyme)
  • Re: The Double or One Half Paradox
    ... you are also missing the discussion of the definition of ... I do not recognize the meaning of my words in your paraphrase. ... meaning of the word "random" in real math problems; ... "random" to describe the amounts in the envelope problems. ...
    (sci.math)
  • Re: The Double or One Half Paradox
    ... you are also missing the discussion of the definition of ... I do not recognize the meaning of my words in your paraphrase. ... meaning of the word "random" in real math problems; ... "random" to describe the amounts in the envelope problems. ...
    (sci.logic)