PDA

View Full Version : MOD operator deprecated



ErosOlmi
02-03-2008, 23:08
Next thinBasic preview version will not anymore have MOD operator but just MOD function.
In other terms it will not be possible to do something like:


MyVar = 10 MOD 1.5 '---MOD operator

but it must be substituted by


MyVar = MOD(10, 1.5) '---MOD function

This will avoid a superflous test inside numeric expression parsing.
MOD function is already present in current thinBasic (both stable and preview) so if you have some code using MOD operator, please change it.

Regards
Eros

Petr Schreiber
03-03-2008, 10:10
No probem for me,

if it make parsing faster then why not.
Lot of languages have MOD as function, so I think it should not confuse anyone.


Petr

ErosOlmi
03-03-2008, 11:34
Yes, I've got some more parsing speed because MOD as operator was taken into consideration at every numeric expression parsing process exactly any other operator (+-*/...) with its operator precedence.

Some TBGL scripts present in TBGL bonus packs has to be changed but I will do it.

Ciao
Eros

Petr Schreiber
03-03-2008, 13:55
I can do it,

I forgot I used MOD in the past ???

I was thinking of converting those samples to most up to date syntax, to not bring more confusion than learning factor :),
so during this process I can watch for MOD operator. This conversion should be done before this preview goes stable.

There are some more possible conflicts, I think because of some keywords added ( like RETURN ).


Bye,
Petr