[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-devel
Subject:    Re: [Gambas-devel] Finding Variant
From:       Benoît Minisini <gambas () users ! sourceforge ! net>
Date:       2012-08-29 21:03:56
Message-ID: 503E83BC.7030702 () users ! sourceforge ! net
[Download RAW message or body]

Le 28/08/2012 17:04, Benoît Minisini a écrit :
> Le 28/08/2012 16:55, Tobias Boege a écrit :
>> Beno�t,
>>
>> is there an easy way to compare Variants? The Variant[] has no Find() and
>> the rest of the compare functions are specific to their datatypes which
>> could all live in one Variant. This is needed for the List.Find*()
>> functions so either "equal" or "not equal" will be enough for a result. (May
>> even memcmp() suffice for that?)
>>
>> Regards,
>> Tobi
>>
>
> No, the Variant comparison has only be implemented in operators. I will
> do that, and then I will add an API to compare two values.
>
> And no, memcmp() is not enough!
>

In revision #5099, you have a new API: GB.CompValue().

It takes two 'GB_VARIANT_VALUE *' 'a' and 'b', and returns 1 if 'a' is 
greater than 'b', -1 if 'b' is greater than 'a', and 0 if 'a' equals 'b'.

When 'a' and 'b' do not have the same type, it tries to do its best 
(conversion if they are not objects, NULL is always the lower value, and 
object is always greater than a non-object...).

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-devel mailing list
Gambas-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic