Page 1 of 1

LEFT, RIGHT, MID Functions in Rules/TI

Posted: Wed May 05, 2010 2:39 pm
by jstrygner
Common functions like LEFT, RIGHT and MID functions both in Rules and TI would make coding much easier to write and read.
  • LEFT('Example', 3) returning 'Exa',
    RIGHT('Example' 3) returning 'ple',
    MID('Example', 2, 4) returning 'xamp'.

Re: LEFT, RIGHT, MID Functions in Rules/TI

Posted: Wed May 05, 2010 3:23 pm
by Steve Rowe
Just checking that you know about subst and delet?

Can't see them implementing functions that already exist but with a different name. It would be nice if TM1 and Excel function names were more closely aligned but I don't see it as too much of a drama. Function names are not even aligned within TM1 (Excel has DBRW, Rules DB and TI CellGetN).....

Re: LEFT, RIGHT, MID Functions in Rules/TI

Posted: Thu May 06, 2010 8:34 am
by jstrygner
I must agree i went to far with MID example (which actually is the same as SUBST). Also the LEFT is easily replaceble with SUBST (just a small difference in syntax).

But the RIGHT function is not that "user friendly" to achieve.

IMHO it is much easier both to WRITE and READ:
"RIGHT(sVariable, 3)"
instead of
"SUBST(sVariable, LONG(sVariable)-2, 3)"
or
"DELET(sVariable, 1, LONG(sVariable)-3)"

But yes, it is not "too much of a drama".