Shop OBEX P1 Docs P2 Docs Learn Events
Trivial math — Parallax Forums

Trivial math

alnajjar1alnajjar1 Posts: 110
edited 2011-05-11 08:38 in BASIC Stamp
I have been coding for the BS2 for years but got stumped when I needed a (not equal) operator. I looked in the manual but couldn't find anything. I used <> but it didn't work. Surely that is doable! any help???

Al

Comments

  • PublisonPublison Posts: 12,366
    edited 2011-05-11 06:59
    In and IF...THEN statment, <> is not equal.

    Page 232 Basic Manual 2.2


    alnajjar1 wrote: »
    I have been coding for the BS2 for years but got stumped when I needed a (not equal) operator. I looked in the manual but couldn't find anything. I used <> but it didn't work. Surely that is doable! any help???

    Al
  • vaclav_salvaclav_sal Posts: 451
    edited 2011-05-11 08:38
    Are your variables of same type?
    That may be a problem but I did not try that.

    This works for me

    Result VAR Word
    Test VAR Word

    test = 1
    DEBUG ? Test
    DEBUG ? result



    IF result <> test THEN
    DEBUG "<> ",CR
    DEBUG ? Result
    DEBUG ? Test
    ELSE
    DEBUG "= ",CR
    DEBUG ? Result
    DEBUG ? Test
    ENDIF
Sign In or Register to comment.