realbasic-nug
[Top] [All Lists]

Re: Enum Casting to Enum?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Enum Casting to Enum?
From: Norman Palardy <npalardy@great-white-software.com>
Date: Sun, 31 May 2009 22:39:20 -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: <C450D749-4D8A-4072-AB06-5E489D3D6E3B@verizon.net>
References: <C450D749-4D8A-4072-AB06-5E489D3D6E3B@verizon.net>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On 31-May-09, at 7:44 PM, Karen wrote:

I am finishing up a little Checkbox drawing utility. I need to have an Enum with one more value than does CheckBox.CheckedState for particular function (besides "if State = CheckBox.CheckedState.UnChecked Then..." gets to be a bit long)

So I defined a Enun in that module:

Enum CheckStates As Integer
 Unchecked
 Checked
 Indeterminate
 AllStates = -1
End Enum

But I also want to support the CheckBox.CheckedState

So I overload the methods thusly:

//---------------------------------
Sub aMethod(State as CheckState)
  ...
End Sub
//---------------------------------

Sub aMethod(State as CheckBox.CheckedState)

  aMethod CheckState(State) ' <------ Gives error

End Sub
//---------------------------------

Why can't I cast a CheckBox.CheckedState to a CheckState? is it a bug?

Or a typo ?
Your Enum is called CheckStates not CheckState



_______________________________________________
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>