We just got a request for something like the following:
put "field 1 of card 3" into X
put Z/4 into value(X)

This isn't supported in any xTalk as far as I can tell, but does seem
like a good idea.  I've never been very comfortable with xTalk's
implied indirect reference behavior:
put "field 1 of card 3" into X
select X

(In MetaCard, this is commonly followed by something like "put Z/4
into the selectedObject", which achieves the original goal, but in
kind of a roundabout way).

There are a lot of cases where this automatic dereferencing works, but
it *is* ambiguous, and there are lots of hand-coded routines in the
engine to distinguish the cases where its OK to dereference a variable
to get an object if that's what's needed (such as when setting a
property).  And certainly an explicit way to do this kind of thing
would be faster than just having the engine try it automatically (and
a *lot* faster than using "do" or "value()" which have vastly more
overhead).

One way to do this would be to have a function that does this, similar
to the way the selectedField() or the foundField() work.  How about:
put "button 1" into X
put "whatever" into objectReference(X)

It might also be possible to do it by adding a new chunk type "object"
that implies a dereference:
put "button 1" into X
put "whatever" into object X

But the latter could get hairy to implement:
put "whatever" into object X of stack "somestack"

Other ideas?
  Scott

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...

Reply via email to