[comp.sys.mac.hypercard] Word Alignment of Pascal Strings on Mac vs Mac 2

edmoy@violet.berkeley.edu (03/02/88)

I don't know if this is only in HyperCard or a general Mac problem, but
I do know that what works on the Mac 2 fails on a Mac+.

I was writing an XFCN for HyperCard, using a handle to data storage needed by
the XFCN.  The XFCN was written in LightSpeed C, but I think the problem
would show up in any C compiler.  In the data is an array of Pascal strings.
Originally the array was declared:

	char field[NFIELDS][17];

The maximum string length is 16, plus one for the length byte.  This worked
fine on my Mac 2, but crashed on my Mac+ when indexing odd numbered strings.
When I changed this to:

	char field[NFIELDS][18];

it worked on the Mac+.  This seems to indicate that Pascal strings must be
word aligned on a Mac+, but not necessarily on a Mac 2.

Edward Moy
Workstation Software Support Group
University of California
Berkeley, CA  94720

edmoy@violet.Berkeley.EDU
ucbvax!violet!edmoy