Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utastro.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!ut-sally!utastro!bill From: bill@utastro.UUCP (William H. Jefferys) Newsgroups: net.micro.mac,net.sources.mac Subject: Re: Misinformation on C strings??? Message-ID: <467@utastro.UUCP> Date: Thu, 1-Aug-85 23:28:31 EDT Article-I.D.: utastro.467 Posted: Thu Aug 1 23:28:31 1985 Date-Received: Sat, 3-Aug-85 08:35:51 EDT References: <385@utastro.UUCP> <1016@sdcsvax.UUCP> Distribution: net Organization: U. Texas, Astronomy, Austin, TX Lines: 69 Xref: linus net.micro.mac:2213 net.sources.mac:469 Joel West suggested the following method for creating C-style null-terminated resource strings: > text.exe > > > type TEXT = GNRL > ,257 > .S > Hello, world\00 > > > type TEXT = GNRL > ,258 > .S > This is a simple string!\00 > > Nothing terribly exciting about that. What I ended up with, according > to Redit, was two strings of resource type "TEXT", each beginning with > a capital letter and ending with $00. > > Now, unless I miss my guess, Rmaker will handle C strings, albeit > manually. The string can then be obtained using astrng = getresource("TEXT",id); Many thanks to Joel for this *vast* improvement. Except for one thing (see below), this seems to solve the problem of getting C strings into RMaker. I will post a new version of SKEL incorporating this idea in due course. Before I do so, however, I'll mention a problem that Joel would not have noticed with the strings he used, but which does exist with the strings in SKEL. That is, if the string includes periods (decimal points - ASCII 2E) then the RMaker program as distributed with Megamax C will not work properly. It compiles a garbage string into the resource fork. I tried various obvious ways to get around this: \2E, \., \2\E, etc., none of which worked. The only way I could figure to get around this was to switch over to Hex (.H) mode in the middle of the string, drop in the desired byte, then switch back to String (.S) mode, as follows: .S Here is the first part of the string .H 2E .S And here is the rest of it!\00 If anyone knows a better way to do this, I would like to incorporate it in the new SKEL. If no one can come up with a better idea within the next week or so, I will post the version I have working now. In the meantime, you might want to experiment with this. Can anyone at Apple address this? The version of RMaker being used is Andy Herzfeld's version dated 10/18/84. -- "Men never do evil so cheerfully and so completely as when they do so from religious conviction." -- Blaise Pascal Bill Jefferys 8-% Astronomy Dept, University of Texas, Austin TX 78712 (USnail) {allegra,ihnp4}!{ut-sally,noao}!utastro!bill (uucp) bill%utastro.UTEXAS@ut-sally.ARPA (ARPANET)