rejetto forum

template macros: true and false

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
this is only for those who uses macros.

at the moment only the empty string and the zero string is considered to be "false".
any other value is true, as stated in the documentation.

i think that the zero value should not be just "0", but also "0.0" in case of non-integers, or "0000".
at the moment this is not.
but from next build any numeric value equal to zero will fit.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2068
    • View Profile
juste missing the word 'false'  ;)

function isFalse(s:string):boolean;
  begin result:=(s='') or (strToFloatDef(s,1) = 0) or (lowercase(trim(s)='false') end;


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
so why not the word "no" ? ;)
and "off" ? it would fit as well.

i'm just trying to keep it "low", because more values we have, more confusion can bring.


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
I think it's a good solution to use 0 and 0.0.

If words like false,no,off,nothing should be used, it would be better tu use a macro {.clear|varname.} , someting that can be done in [special:alias]: set to 0 !
your computer has no brain - use your own !