[Gambas-devel] Comp("FICHA" = "FICHA", gb.IgnoreCase) always return 1 !!!!!!

Tobias Boege tobias at ...692...
Wed Jul 3 21:35:39 CEST 2013


On Wed, 03 Jul 2013, PICCORO McKAY Lenz wrote:
> i made
> 
> 
> Comp("FICHA" = "FICHA", gb.IgnoreCase)
> 
> and returns me 1
> 
> and if i compared with a var returns always -1
> 
> 
> this its a bug? or maybe theres another way!?

Firstly, don't send a question to gambas-user and gambas-devel at the same
time. Even if their topics are not mutual exclusive, chances are high that
the question is not appropriate for one of both lists - which is the case
here for gambas-devel.

Secondly, do you know Gambas at all? The signature of Comp() is

	Comp(String1, String2 [, Mode])

"FICHA" = "FICHA" is a boolean expression in Gambas. Since both strings are
equal, it returns TRUE which is subsequently converted to a string "T". Your
second string argument is gb.IgnoreCase which is converted to the string "1"
and "T" is greater than "1" which is exactly what Comp() returns, i.e. 1.

The code you probably wanted to write is:

	Comp("FICHA", "FICHA", gb.IgnoreCase)

Regards,
Tobi





More information about the Devel mailing list