Author |
Message |
the_short1
|
Posted: Mon Feb 23, 2004 10:57 pm Post subject: can someone tell me the use of += and -= operators (SOLVED) |
|
|
ive seen this in some programs but i do not know how/what it does exactly.... ive looked in turing help under operators... and i searched but no luck in finding it... |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Paul
|
Posted: Mon Feb 23, 2004 11:00 pm Post subject: (No subject) |
|
|
hehe...
+= is the same as something:=something + something else
-= is the same as something:=something - something else
so
code: |
number:=number+1
%is the same as%
number+=1
number:=number-1
%is the same as%
number-=1
|
|
|
|
|
|
|
the_short1
|
Posted: Tue Feb 24, 2004 7:52 am Post subject: (No subject) |
|
|
that was my first guess.... but i wanted to knwo for sure...(also if it has more uses...)
cool... that little things shaves off lots of code...
Thanks,.. (Feeling Like a Noob) |
|
|
|
|
|
naoki
|
Posted: Tue Feb 24, 2004 5:46 pm Post subject: (No subject) |
|
|
mebbe it's only in C++ but you could also try
*= and
/=
and see if they work as well |
|
|
|
|
|
apomb
|
Posted: Tue Feb 24, 2004 8:09 pm Post subject: (No subject) |
|
|
actually in turing , it works quite well ... i was initially going to reply that even (+=) doesn't work .. but i would have made quite a fool of myself , wouldn't i!? any way ... it works |
|
|
|
|
|
jonos
|
Posted: Tue Feb 24, 2004 9:00 pm Post subject: (No subject) |
|
|
yeah, cervantes uses that a lot and i never understood his code until i understood that. anyways, i wish turing allowed var++ or ++var cause that is SOOOOOO easy. hehe, anyways, everyone go and check out "shadows collide with people" by john frusciante |
|
|
|
|
|
|