Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Using Resource Fork to store data Message-ID: <9214@goofy.Apple.COM> Date: 18 Jul 90 00:04:51 GMT References: <1990Jul17.172044.20361@Neon.Stanford.EDU> Distribution: na Organization: Apple Computer Inc., Cupertino, CA Lines: 27 In article <1990Jul17.172044.20361@Neon.Stanford.EDU> Peter Commons writes: >I'm currently working on a new multi-user game for the Mac. In thinking about >how I would like my save file to look, it would be very convenient to have >one resource with the main data and one resource with the data for each player >(rather than have all the data sequentially laid out in the data fork) because >the game will only need to look at one player's info at a time. > >Can I do this? If so, should I use my own (non-reserved) resource name? And if >I define my own resource type, how do I specify it's length (or does it >automatically make it as long as the handle I pass it when I call AddResource? Yes, you can do that. And, yes, you should use a non-reserved resource name. AddResource will make a resource that's as big as the handle you pass to it. Typically your program would have a record that defines the player data and you'd pass the sizeof() that data to NewHandle to create the handle... steve -- ____________________________________________________________________ Steve Christensen Internet: stevec@goofy.apple.com Apple Computer, Inc. AppleLink: CHRISTENSE1 20525 Mariani Ave, MS 81-CS CompuServe: 76174,1712 Cupertino, CA 95014 "You just contradicted me." "No I didn't." ____________________________________________________________________