what is the method you use to save a specific field reference in a variable or custom property?

Phil Davis revdev at pdslabs.net
Tue Sep 12 20:27:22 CDT 2006


Hi Josh -

Josh Mellicker wrote:
> Maybe someone can shed some light on the best way to put a field 
> reference into a variable (or custom property).
> 
> 
> If I do this:
> 
>   set the uFldRef of me to the long name of fld "whatever"
> 
> It seems to work great.
> 
> 
> Then, if I try to access that custom property:
> 
>   put the uFldRef of the target into tFldIWant
> 
> it seems to work fine.
> 
> 
> But when I try to do something, like:
> 
>   put the text of fld tFldIWant into x -- error
> 
> or
> 
>   put the text of tFldIWant into x - error

This last one should work.

Try doing an "answer tFldIWant" before using the variable as a field reference. 
Maybe it's empty. Maybe the uFldRef was stored as the custom prop of some object 
other than the one you think. If so, that could cause the problem.

I tried a test using the last approach listed above & it works fine here.

HTH -
Phil Davis



More information about the use-livecode mailing list