[comp.sys.mac.hypercard] Parameters to XCMDs

aisl@ur-tut (Larry Landry) (05/28/88)

In article <43294GFX@PSUVM> GFX@PSUVM.BITNET writes:
>
>If called with:       Put test(1,2) into someContainer
>the XFCN returns 2, as expected.  However, if the string 1,2 is in a container,
>a call such as:       Put test(field someField) into someOtherContainer
>returns garbage of the form :  W>>W>>W>> (etc.)
>

The problem is that the two lines you have pass different information into
your XCMD

test(1,2) passes 2 arguments into HyperCard.  The first is '1', and the 
	 second is '2'.

test(a) where a is '1,2' passes 1 argument into the XCMD that evaluates to
	 '1,2'.

Therefore, your program is not getting a valid handle for the second argument.
You should instead use the line

test(item 1 of a, item 2 of a)

to pass in two arguments as you need.

Larry Landry
University of Rochester