since this thread is up already- even if i can not read a message by Marko Marko...
the idea was this - and still desired:
(without knowing it i started similar idea-thread a while ago here: http://www.thinbasic.com/community/s...ating-thoughts )
'current working syntax:
Type t_myColors
IndianRed As Long ' all UDT-members are same type for sure
LightCoral As Long ' long in this case
Salmon As Long
'...
End Type
Global myColor as t_myColors
With myColor
.IndianRed = &H5C5CCD
.LightCoral = &H8080F0
.Salmon = &H7280FA
'...
End With
' "myColor-Enumeration" is ready for use now
the desired syntax:
Enumerate myColor As Long
IndianRed Value &H5C5CCD
LightCoral Value &H8080F0
Salmon Value &H7280FA
'...
End Enumerate
now myColor should be somewhat like a dimensioned and all assigned UDT
without having to Dim a variable of this type (indeed its impossible -there's only ONE!)
so now can use for example
whatever.SetColor(myColor.Salmon) ' all "myColor"-constants are nicely grouped now
values are constant and udt-members are all of of same type - as an array mostly
-nevermind that the Enumeration equals TB-%RGB-Equates- just an example what for it is used...
thinkeable too:
Begin Const
Enum %myColor As Long
IndianRed Value &H5C5CCD
'...
End Enum
End Const
whatEver.SetColor(%myColor.MidnightBlue)
Bookmarks