[Gambas-user] Question about Object.Size and object symbol enumeration

tobias tobiasboe1 at ...20...
Mon Jan 16 18:28:17 CET 2012


Jussi Lahtinen schrieb:
>> i think, i'm not the man to answer your first question (maybe it is some
>> alignment/padding thing).
>>
> 
> No no it's about memory size...
> 
> 
> 
> 
>> but for the second question: Class.Symbols and Class[sSymbol] will do it:
>>
>> DIM sSym AS String
>> DIM hCls AS Class
>>
>> ' let hObj be the instance of your big exported class (btw, you don't
>> ' need to have an instance for this, i think...)
>> hCls = Object.Class(hObj)
>>
>> FOR EACH sSym IN Classes[hCls.Name].Symbols
>>   IF hCls[sSym].Kind = Class.Constant THEN
>>     PRINT "constant: "; sSym; " = "; hCls[sSym].Value
>>   ENDIF
>> NEXT
>>
> 
> Looks like exactly what I need! Thanks!
> 
> Jussi

i have to correct me a bit:

FOR EACH sSym IN Classes[hCls.Name].Symbols

in fact contains overhead (i tested it first without the hCls variable 
and had to use Classes[sName] then)... simply use:

... IN hCls.Symbols




More information about the User mailing list