Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp.vuw.ac.nz!virtue!ccc_ldo From: ccc_ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Newsgroups: comp.sys.mac.hypercard Subject: Re: Reading files containing X'00 (growl) Message-ID: <1093.26adca68@waikato.ac.nz> Date: 25 Jul 90 04:35:52 GMT References: <1990Jul17.121924.25050@watserv1.waterloo.edu> <1064.26a73cfd@waikato.ac.nz> <43234@apple.Apple.COM> Organization: University of Waikato, Hamilton, New Zealand Lines: 24 In <43234@apple.Apple.COM>, bc@Apple.COM (bill coderre), says, in response to my grumble about null-terminated strings in HyperCard, "Would you rather they used P-strings, which could theoretically contain 00's (except that certain Toolbox routines (such as all the Text Edit rouitines) would barf), but which restrict text to 255 characters?" No, I wouldn't. HyperCard strings are stored as relocatable blocks, aren't they? Well, what's wrong with GetHandleSize for getting the length of the string? Granted it can be slow changing the size of the block all the time, so for compute-intensive operations inside HyperCard you'd just maintain a separate temporary longword count for each string, and then do a final SetHandleSize on each string at the end. There's a bit more detail than that, but you get the idea--use a count instead of a terminating null. How about passing this one on to the HyperCard team? Lawrence D'Oliveiro Computer Services Dept fone: +64-71-562-889 University of Waikato fax: +64-71-384-066 Hamilton, New Zealand electric mail: ldo@waikato.ac.nz