Shop OBEX P1 Docs P2 Docs Learn Events
Greater than/Less than — Parallax Forums

Greater than/Less than

NewzedNewzed Posts: 2,503
edited 2006-07-03 14:05 in Propeller 1
In PBasic I write:

if x>y.......
if x<y......

How would I write this in Spin?

Thanks

Sid

Comments

  • CJCJ Posts: 470
    edited 2006-07-02 15:33
    pretty much the same way,

    a huge part of chapter four is devoted to operators, this one included

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-02 15:59
    Do be careful with "greater or equal" and "less than or equal". In PBasic, these are ">=" and "<=", but in Spin, these are "=>" and "=<" because of the way that assignment operators are generalized. In Spin, "a <= b" means "a := a < b" and "a >= b" means "a := a > b".
  • NewzedNewzed Posts: 2,503
    edited 2006-07-02 16:49
    I don't want to "or equal to" -· just greater than or less than.· In Spin would I write simply:

    if x>y...

    or

    if x<y...

    Thanks

    Sid
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-02 17:06
    Yes
  • NewzedNewzed Posts: 2,503
    edited 2006-07-02 17:39
    Thank you, Mike

    Happy Bang-Bang Day.

    Sid
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-07-03 14:05
    I fall to this "issue" often, and have to stop and "think spin" when the logic doesn't do what its ment to do.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
Sign In or Register to comment.