[Gambas-user] System colors

Bruce Steers bsteers4 at gmail.com
Fri May 5 16:46:57 CEST 2023


On Fri, 5 May 2023 at 15:38, Bruce Steers <bsteers4 at gmail.com> wrote:

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

Or even less , just this...

 For Each sSymbol As String In Classes["Color"].Symbols
   If Classes["Color"][sSymbol].Kind = Class.Constant Or If
Classes["Color"][sSymbol].Kind = Class.Property Then $Colors[sSymbol] =
Object.GetProperty(Color, sSymbol)
 Next
;)
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230505/34eff6f5/attachment-0001.htm>


More information about the User mailing list