Shop OBEX P1 Docs P2 Docs Learn Events
An easy question... but I can't figure it out — Parallax Forums

An easy question... but I can't figure it out

Angela1Angela1 Posts: 25
edited 2009-03-05 10:10 in BASIC Stamp
Hello, quick question: Are there any "less than or greater than" commands in stamp? I am trying to perform an instruction within a set of values so the·< and·> little guys would be very helpful... >_<

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-03-04 08:26
    Of course. Take a look in the Basic Stamp Syntax and Reference Manual under 232.
  • Angela1Angela1 Posts: 25
    edited 2009-03-04 08:44
    SRLM said...
    Of course. Take a look in the Basic Stamp Syntax and Reference Manual under 232.
    hmmmm, i think we have different manuals... unless you mean using the POLLRUN command from the Basic·Stamp Manual v.2...·Is that right???
  • UghaUgha Posts: 543
    edited 2009-03-04 12:40
    Take a look at the helpfile... look at the IF statement. It lists < and > as valid Comparison operators.
    Is this what you meant? If not please explain what your trying to do so we can better help you.
  • SRLMSRLM Posts: 5,045
    edited 2009-03-04 17:08
    I'm using version 2.2
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-03-04 18:58
    Angela,

    The math operators are all explained in one section near the beginning, and also there is a long section on the IF command and its variants, and the SELECT:CASE command, and the LOOKDOWN command.
    examples:
    IF x<500 AND x>=200 THEN GOTO midrange
    
    SELECT x
      CASE >=500
         GOTO highrange
      CASE <200
         GOTO lowrange
      CASE ELSE
        goto midrange
    ENDSELECT
    
    LOOKDOWN x,<[noparse][[/noparse]200,501,65535],y
    ' y is 0,1, or 2 depending on range of x
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Angela1Angela1 Posts: 25
    edited 2009-03-05 10:10
    urrgg for some reason I didn't get an email notice of your helps... THANKS GUYS SO MUCH!!!
Sign In or Register to comment.