AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

[Bug?] Comparison opertors do not work properly
 
 

Hello.
I think I found a bug with the “<” and “>” operators. If I don’t put spaces between the variable and the integer, the comparison is always False.

Here is some examples:

ttests
 $var50 
50
 $var200 
200

 
# these two comparisons are always False, no matter the variable:
 
if($var50<100{ ok }
 
else { incoherent 1 }

 
if($var200>100{ ok }
 
else { incoherent 2 }

 
# these comparisons work properly:
 
if($var50 100{ ok }
 
else { incoherent 3 }

 
if($var200 100{ ok }
 
else { incoherent 4 }

 
if($var50<=100{ ok }
 
else { incoherent 5 }

 
if($var200>=100{ ok }
 
else { incoherent 6 } 

And then there is this one, if I don’t put spaces and the variable is called via a macro, the comparison is always True:

outputmacro: ^test(^variable)
 
# this comparison is always True, no matter the variable:
 
if(^variable>100{ over 100 }
 
else { under 100 }

 $var 
= ^variable
 
# this comparison is always False, like in my first example:
 
if($var>100{ over 100 }
 
else { under 100 }


topic
: ~debut repeat []

t
please type a number.

u: (_~number)
 
your number is ^test(_0

Is this a bug or a feature I didn’t read about?
Anyway this is disturbing, and it took me a long time to figure out what was the problem.

I hope it helps.

 

 
  [ # 1 ]

Neither or both. I was lazy and required you to separate your tokens. I have now fixed this for next release.
Sorry for the inconvenience.

 

 
  [ # 2 ]

All right!
Thanks for your quick answer.

 

 
  login or register to react