Indirect Reference

Graham Samuel graham.samuel at wanadoo.fr
Mon Mar 8 05:41:22 EST 2004


On Sun, 07 Mar 2004 16:21:53 -0400, Jim Carwardine 
<JimCarwardine at OwnYourFuture-net.com> wrote:


>I¹m having trouble with something that should be very simple to do.  Maybe
>someone can tell me what I¹m missing...
>
>I¹m building a reference to a specific field in a nested group in a
>scrolling group:
>
>     get quote & "actionStepDueDate" & quote & " of group " & quote &
>theGroup & quote
>     put getTheDate(field it) into field it
>
>When I execute this statement, ³it² contains... ³actionStepDueDate² of group
>³actionStep1²
>
>I¹m getting an error ­ ³no such object² when I execute the second statement
>and I don¹t see what I¹m doing wrong... Jim
>--

and

>So, now I know that the field reference syntax is ok.  The problem seems to
>be the indirect reference.  When the function getTheDate gets the parameter,
>it is not the contents of the field, but the field name as it was put into
>the variable "it".  Is there a technique with indirect object references?
>Jim


It strikes me that you have left the 'the' out of the 'get' statement, 
since apparently you're referring to a custom property; but in terms of 
indirection you're working too hard as the engine itself will evaluate 
'theGroup' and use its contents. So your 'get' line should read:

  get the actionStepDueDate of group theGroup

Then I think it should work. Seems to work here, anyway. If you want to get 
any more indirect than this, use a 'do' statement, which evaluates a string 
before executing it.

HTH

Graham



---------------------------------------------------
Graham Samuel / The Living Fossil Co. / UK & France  




More information about the use-livecode mailing list