realbasic-nug
[Top] [All Lists]

Re: Operator_Compare with variant objects?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Operator_Compare with variant objects?
From: Joe Strout <joe@inspiringapps.com>
Date: Sat, 30 May 2009 14:38:46 -0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <354C7C2B-A6EA-464C-951C-810B8A072B66@xochi.com>
Organization: Inspiring Applications, Inc.
References: <AEF09038-DB63-4857-BBE1-AE5D13AA6FF3@xochi.com> <3AA0AEC2-D230-4A4C-8788-84C3FCC17A44@great-white-software.com> <9142A64B-6ACF-4072-B847-82A5C7098969@xochi.com> <354C7C2B-A6EA-464C-951C-810B8A072B66@xochi.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
Michael Diehr wrote:

(a side note):

The LR is a bit confusing:

Issue 1:  it lists
  Variant.Operator_Compare(v) as integer

  yet this code won't compile:
    dim v1,v2 as variant
    if v1.Operator_Compare(v2) = 0 then ...

Wow, that sure is confusing. I think it's just trying to say that you can compare Variants, and it compares the values they contain.

"Variant.Operator_Compare(v) as integerUsed to define all the comparison operators for the Variant. If Operator_Compare is defined, it is called whenever any of the comparison operators are used to compare the Self instance of the class with another instance. The following comparison operators are covered: =, <, >, <=, >=, <>. Operator_Compare returns an integer whose meaning is as follows: <0 means that Self is less than the passed parameter, 0 means that Self is equal to the passed parameter, and >0 means that Self is greater than the passed parameter"

I'm not sure what this means.

Me either. I think the doc writer here is trying to explain Operator_Compare methods in general (but bungling the job). As far as I know, there is nothing we, as RB users, can do to define an Operator_Compare for Variants. We define them for our own classes instead.

Best,
- Joe

--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>