[comp.sys.mac.hypercard] Hypercard XCMD Gotchas

chavez@endor.UUCP (11/13/87)

     I've just spent the past three hours nailing this bug.
Here's the story.  Take any of the APDA XCMDs (e.g., flash)
and add the following definitions inside the main routine
called by Entrypoint:

	CONST 
	    kMaxFields = 1;
	    kMaxType = 1;

	TYPE FieldRec = RECORD
	    fieldNames: 	ARRAY [1..kMaxFields] OF STRING;
	    suffices:		ARRAY [1..kMaxFields] OF STRING;
	END;

	VAR
	    fieldInfo: ARRAY [1..kMaxType] OF FieldRec;

Now follow the usual procedure for compiling, linking, and pasting
with ResEdit.  Invoke the XCMD from Hypercard, and watch Hypercard
die a miserable death with error 28.  It seems that you can't have
local arrays with records in them; there's probably some funny
business going on at initialization time.

Be careful!

		R. Martin Chavez
		Dept. of Computer Science
		Stanford University