Shop OBEX P1 Docs P2 Docs Learn Events
Question about variable "limit" operators — Parallax Forums

Question about variable "limit" operators

MicrocontrolledMicrocontrolled Posts: 2,461
edited 2010-07-13 06:25 in Propeller 1
If you assign a variable the limit command ("=#>" or "=#<") does this make the variable NEVER go over/under the assigned limit? For the life of the variable?

Thanks,
Micro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!

Use the Propeller icon!! Propeller.gif

Follow me on Twitter! Search "Microcontrolled"

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-13 01:34
    "For the life of the variable?" ... No. The limit operators are not declarations of conditions. They're operators that are executed when the program reaches that point. "A =#> B" is just a shorthand for "A := A #> B". Similarly, "A =#< B" is just a shorthand for "A := A #< B".· The shorthand form also takes a little less memory and executes slightly faster than the full form.
    ·
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-07-13 01:44
    Oh, ok. Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my new website!!

    Use the Propeller icon!! Propeller.gif

    Follow me on Twitter! Search "Microcontrolled"
  • heaterheater Posts: 3,370
    edited 2010-07-13 06:25
    Except the operators are "#>=" not "=#>" and "<#=" not "=#<".

    According to my BST listing output the short hand forms do save you one byte code over the long hand versions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
Sign In or Register to comment.