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: Karen <keatk@verizon.net>
Date: Mon, 01 Jun 2009 01:21:16 -0400
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: <17C0FDBA-DB06-480C-B695-8D8D3322CBCF@great-white-software.com>
References: <C450D749-4D8A-4072-AB06-5E489D3D6E3B@verizon.net> <17C0FDBA-DB06-480C-B695-8D8D3322CBCF@great-white-software.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Jun 1, 2009, at 12:39 AM, Norman Palardy wrote:


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


In the first case at least there was no Typo. Here is the code copy and pasted.

Sub DrawCheckmark(Extends g as Graphics, State As CheckBox.CheckedStates, X as integer, Y As Integer, Size as Integer = 0, Height As Integer = 0, Width As integer = 0)
  g.DrawCheckmark CheckStates(State), X,Y, Size, Height, Width
End Sub

Here is the error message:

Code, Dingbats.DrawCheckmark, line 1, Type mismatch error. Expected Dingbats.CheckStates, but got CheckBox.CheckedStates, g.DrawCheckmark CheckStates(State), X,Y, Size, Height, Width

But I was wrong in the second case and must have had a typo because this complies: (copy and pasted)

g.DrawCheckmark CheckStates(Integer(State)), X,Y, Size, Height, Width


While I would expect to be able to do CheckStates(State) doing CheckStates(Integer(State)) is a trivial workaround.


For a REALLY frustrating bug i spent a couple of hours banging my head against the wall before I realized the problem was not me , and which will mean major design change and ... see my next Email...

- karen

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