Shop OBEX P1 Docs P2 Docs Learn Events
PBASIC 2.5 command suggestion — Parallax Forums

PBASIC 2.5 command suggestion

James AndersonJames Anderson Posts: 52
edited 2006-07-15 01:31 in BASIC Stamp
Hello,
is there a command in pbasic that is short hand for the instruction

variablexyz = variablexyz * 2

any suggestions appreciated...

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There once was a lady named Bright
who traveled much faster than light
She departed one day in a relative way
and Returned on the Previous Night

Cheers,
Wannabe Ub3r Geek

World of Warcraft
Star Trek official website
Google (Man's best friend...)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-14 23:36
    Another command that functionally does the same is: variablexyz = variablexyz << 1
    There's not really anything shorter. SPIN (for the Propellor) does have a short hand like in "C",
    but PBasic does not have this short hand. SPIN lets you write: variablexyz <<= 1 or variablexyz *= 2.
    The two statements in PBasic are pretty much the same in execution speed. The interpreter overhead
    washes out any differences between the operators.
  • James AndersonJames Anderson Posts: 52
    edited 2006-07-15 01:31
    ok thanx for the advice

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There once was a lady named Bright
    who traveled much faster than light
    She departed one day in a relative way
    and Returned on the Previous Night

    Cheers,
    Wannabe Ub3r Geek

    World of Warcraft
    Star Trek official website
    Google (Man's best friend...)
Sign In or Register to comment.