Page 1 of 1

Script Syntax, Variables, Numbers...

Posted: 11 Sep 2008 01:36
by jacky
So the new syntax when it comes to variable is pretty cool, and with the use of concatenation and all it looks pretty "standard":

Code: Select all

  $f = "foo";
  $b = "bar";
  $fb = $f."-".$b;
  msg '$fb = "'.$fb.'"';
But then, it becomes very tempting to use it with numbers the same way, only to be reminded you have to use command incr for that...

Code: Select all

  $n = 42;
  msg $n;
  $n = $n - 23;
  msg $n;
  incr $n, $n, -23;
  msg $n;

Re: Script Syntax, Variables, Numbers...

Posted: 11 Sep 2008 08:49
by admin
Yes, I see. Should be added some day. But is a can of worms because then you want all the number tricks and parentheses and binary math etc...