[Gambas-user] string operator == and others

Demosthenes Koptsis demosthenesk at ...626...
Wed Nov 10 14:52:35 CET 2010


On Wed, 2010-11-10 at 14:36 +0100, Benoît Minisini wrote:
> > i also check these, i use gambas2-2.21 rev3289 updated today (10/11/2010
> > dd/mm/yyyy).
> > 
> > PRINT "abc" < "abc"  'false
> > PRINT "abc" < "aBc"  'false
> > PRINT "ABC" < "abc"  'true
> > 
> > are these correct?
> > in http://gambasdoc.org/help/cat/stringop says
> > Returns if String1 is strictly lower than String2.
> > 
> > PRINT "ABC" < "abc"  'true
> > 
> > is this correct? Lower means lowercase not capital, is it?
> > If so "ABC" is greater than "abc".
> > 
> > Also
> > PRINT "abc" > "abc"  'false
> > PRINT "abc" > "aBc"  'true
> > PRINT "ABC" > "abc"  'false
> > 
> > PRINT "abc" <= "abc"  'true
> > PRINT "abc" <= "aBc"  'false
> > PRINT "ABC" <= "abc"  'true
> > 
> > PRINT "abc" >= "abc"  'true
> > PRINT "abc" >= "aBc"  'true
> > PRINT "ABC" >= "abc"  'false
> 
> Strings are compared using binary comparison, i.e. the ASCII value of their 
> characters. In ASCII, 'A' < 'a'.
> 
> Regards,
> 

you mean that
PRINT "A" < "a"   'true

is similar like that
PRINT Asc("A") < Asc("a") 'true






More information about the User mailing list