EDIT: Killed measly request...
EDIT: Updated request:
Currently we have shorthand functions for various operations (e.g. INC, DEC, POW, MOD), but nothing for multiplying and dividing. Could we have functions like 'MUL' and 'DIV' to complete the operator set?
The following operators are available in C++:
+=, -=, *=, /=, %=, >>=, <<=, &=, ^=, |=
Could they be allowed through by GPC? They can be useful in code, and are supported natively in C++, so from what I know the precompiler won't have to do any conversion.
Anyway, could these be 'included' in the allowed syntax?
Thanks.
not basic-like!
I know, but it would still be nice to have at least '*=' and '/=' like there is INC and DEC... Admittedly the others are more complicated and unneeded...
...so with that in mind actually can I update my request? Perhaps we could have some three letter functions like INC and DEC for multiplying and dividing? MUL and DIV maybe?
GLB supports this sentences. I think *= or <<= is more C-like than BASIC.
INC var, 2 // var += 2
DEC var, 2 // var -= 2
INC var // var++
DEC var // var--
var = ASL(var, 2) // var <<= 2
var = ASR(var, 2) // var >>= 2
You can use too:
INLINE
var *= 2;
ENDINLINE
I know, but it's still missing short multiply and divide functions. It would be nice to have the same shorthand method for all different common operations.
We have INC, DEC, MOD, bAND bOR etc., ASL, ASR, and POW but no MUL and DIV...
QuoteI think *= or <<= is more C-like than BASIC
I see the point and I agree :giveup:. Updating my request (as I did in the second post... :rtfm:), as we have commands for every single one of the 'something=' ops. except '*=' and '/=' it would nice to include something like 'MUL' and 'DIV'.
Using MUL and DIV would offer no advantage (typing or execution optimisation) over using things like a%=a%*4
What about "NewParticle.alpha = NewParticle.alpha * 0.8"? :S
I know it's a measly request, but it would be nice to complete the set of functions...
BING!
I'll add it though, it's easy to do.