Drawing a blank on simple code...

Phil Davis phil at pdslabs.net
Tue May 19 18:46:31 EDT 2020


You're almost there Paul!

On 5/19/20 2:18 PM, Paul Dupuis via use-livecode wrote:
> I have a set of custom properties in stack "X", a lot of which begin 
> with "options_<somename>"

So I assume these are members of a customPropertySet, whose name I'll 
call "myOptions".

>
> I want to loop through them and get the values, so I have:
>
>   local tDisplayList
>   put the customKeys of stack "X" into tProperties
To prevent the unintended, I would do this instead:
       put the customKeys["myOptions"] of stack "X" into tProperties

> filter lines of tProperties with "options_*"
>   if tProperties is empty then exit to top
>
>   repeat for each line tLine in tProperties
>     put the customKeys[tLine] of stack "X" into tProp
This should work:
         put the myOptions[tLine] of stack "X" into tProp
>
>     -- do stuff here
>   end repeat
>
>
> When I walk through this code in the debugger, I see that tProperties 
> gets a list of the names of all custom properties in the "X" stack. YEA!
>
> Then I see that that list correctly gets filtered to just those that 
> begin with "options_" YEA!
>
> Then I see the in the repeat loop the variable "tLine" get the name of 
> each "options" property in succession. YEA!
>
> PROBLEM: put the customKeys[tLine] of stack "X" into tProp DOES NOT 
> fetch the value of the indicated property into tProp????
>
> I know this is simple - and I have coded it before - but I can seem to 
> find my past code in prior projects and obviously am missing something.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

Best -
Phil Davis





More information about the use-livecode mailing list