LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Return value of Property Get when using enumerated type

Not sure if there's any help available for this one!
In a class module named PlayingCard I have:

public enum enumColour
CdRed = 1
CdBlack = 2
end enum

private mColour as string

property let CardColour(byval clntColour as enumcolour)
select case clntColour
case CdRed,CdBlack
mColour = clntColour
case else
'error trapping goes heer
end select
end property

property get CardColour() as enumColour
CardColour = mColour
end property

Then in a standard module:

dim NewCard as PlayingCard

Sub CheckitOut
set NewCard = new PlayingCard
With NewCard
.cardcolour = CdRed
end with

debug.print "The Cards colour: " & newcard.cardcolour

end sub


What I'm left with in the immediate window is:
The Cards colour: 1

But what I want returned in the immediate window is
The Cards colour: CdRed

Am i doing something wrong? or is there no way around this using the above code.

Any help greatly appreciated
Jason
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Property Let: assign return value of Double when passing String Tetsuya Oguma Excel Discussion (Misc queries) 1 March 3rd 06 08:01 AM
Type in letter return word Marta Excel Worksheet Functions 5 September 10th 05 10:51 PM
Enumerated constants defined where? JW[_5_] Excel Programming 6 July 23rd 04 10:47 AM
Using Property Let with a Type as member of a Class Ken Dahlberg Excel Programming 5 December 21st 03 05:57 AM
How to find what object type is returned from Selection property ? Krzysztof Klimczak[_3_] Excel Programming 1 October 2nd 03 11:33 PM


All times are GMT +1. The time now is 01:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"