Xref: utzoo comp.sys.mac.hypercard:316 comp.sys.mac:11989 Path: utzoo!mnetor!uunet!husc6!rutgers!mcnc!thorin!unc!steele From: steele@unc.cs.unc.edu (Oliver Steele) Newsgroups: comp.sys.mac.hypercard,comp.sys.mac Subject: Re: HyperCard XFCNs in MPW C Message-ID: <1015@thorin.cs.unc.edu> Date: 3 Feb 88 15:24:56 GMT References: <226STORKEL@RICE] <3105@watcgl.waterloo.edu] <16007@think.UUCP] Sender: news@thorin.cs.unc.edu Reply-To: steele@unc.UUCP (Oliver Steele) Organization: University Of North Carolina, Chapel Hill Lines: 35 kdmoen@watcgl.waterloo.edu {Doug Moen} writes: }You can't have global variables *or character string literals* in }an XFCN written in MPW C. }[....] }Some kludges for faking string literals: }* You can put them into STR# resources ephraim@vidar.think.com.UUCP [ephraim vishniac] writes: ]That's the correct method. Or 'STR ' resources, or any custom ]resource that takes your fancy (preferably with a ResEdit TMPL, to ]make editing easy). }Both kludges are really pretty awful, but I have no better ideas right }now except to write a preprocessor for stripping out string literals }and replacing them with something that the linker won't choke on. ]What's awful about putting your strings into string list resources? ]It's not popular C hacker's style, but it's a hell of a lot easier ]than recompiling every time you want to change some trivial message. What's awful is that most (all?) of the existing HyperCard resource movers, XFCN installers, etc., will copy only your XFCN or XCMD, without checking to see if there are any 'STR 's or 'STR#'s with the same number. Perhaps it's time for Apple to roll out those RSV[12]s for X*s, but until and unless some method of associating X*s with their owned resources becomes a standard, don't use extra resources if your code is meant to be user-installable. Lost are the days when we can assume that anybody installing or moving resources is a hacker with ResEdit. ---------------------------------------------------------------------------- Oliver Steele ...!uunet!mcnc!unc!steele steele@cs.unc.edu "If they weren't guilty, they wouldn't be suspects" -- Ed Meese