[Gambas-user] System colors
Bruce Steers
bsteers4 at gmail.com
Fri May 5 16:38:32 CEST 2023
On Fri, 5 May 2023 at 12:45, Martín <mbelmonte at belmotek.net> wrote:
> ok, the final code is.
>
> Dim myClass As Class = Classes["Color"]
> Dim sSymbol As String
>
> For Each sSymbol In myClass.Symbols
> If myClass[sSymbol].Kind = Class.Constant Then
> $Colors[sSymbol] = myClass[sSymbol].Value
> Else If myClass[sSymbol].Kind = Class.Property
> $Colors[sSymbol] = Object.GetProperty(Color, sSymbol)
> Endif
> Next
>
> Thanks Bruce.
>
> Best regards.
>
> Martin.
>
cool, you're welcome :)
you could even trim it down to this..
Dim myClass As Class = Classes["Color"]
Dim sSymbol As String
For Each sSymbol In myClass.Symbols
If myClass[sSymbol].Kind = Class.Constant Or If myClass[sSymbol].Kind =
Class.Property Then $Colors[sSymbol] = Object.GetProperty(Color, sSymbol)
Next
Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230505/38cebe9b/attachment.htm>
More information about the User
mailing list