Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!tut.cis.ohio-state.edu!kazoo.cis.ohio-state.edu!jgreely
From: jgreely@kazoo.cis.ohio-state.edu (J Greely)
Newsgroups: comp.sys.mac.hypercard
Subject: Re: "set name of target" problem
Message-ID: <14683@tut.cis.ohio-state.edu>
Date: 31 May 88 17:46:30 GMT
References: <8724@dartvax.Dartmouth.EDU>
Sender: news@tut.cis.ohio-state.edu
Distribution: comp.sys.mac.hypercard, comp.sys.mac
Organization: THE Ohio State University, CIS Dept.
Lines: 40

In article <8724@dartvax.Dartmouth.EDU> boz@eleazar.dartmouth.edu 
(John Boswell) writes:
>	This doesn't work, since unlike "New Button", there is no default
>name for a "New Field".  Thus I have to put the following line after
>domenu:
>
>set the name of the target to "New Field"
>
>but this doesn't work as expected!!!

Ah, yes.  "Name of the target".  I ran into this mess when I wanted to
say "number of lines in the target", which returns 1.  The correctly
convoluted syntax turned out to be "number of lines in field short name
of the target".  Unfortunately, your field doesn't have a name.

  My initial suggestion was that you try 'set the name of field id the
target to "New Field"'.  This is wrong.  Firing up HyperCard revealed
that the following script achieves what you want (in 1.1):

on MouseUp
  put last word of the target into temp
  set name of field ID temp to "New Field"
end MouseUp

If you try just saying 'set name of field ID last word of the target
to "New Field"', the name will change, but the script will bomb.
Apparently you cannot change "name of the target" directly.

>  It seems that what is returned for
>"target" is the CARD id!!!  If I do:

  Your other problem (testing in the message box) is buried in
Goodman's monster ("Volume 2 (I cut my copy in half at Part Three),
pg. 557): "If you try typing _the_target_ into the message box, it
will always return the current card's ID number, ..."
-=-
       (jgreely@cis.ohio-state.edu; ...!att!cis.ohio-state.edu!jgreely)
		  Team Wheaties says: "Just say NO to rexd!"
	       /^Newsgroups: .*\,.*\,.*\,/h:j   /[Ww]ebber/h:j
	       /[Bb]irthright [Pp]arty/j        /[Pp]ortal/h:j