Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!rex!ames!dftsrv!mimsy!mojo!russotto From: russotto@eng.umd.edu (Matthew T. Russotto) Newsgroups: comp.sys.mac.programmer Subject: Re: creating resources Message-ID: <1991Mar24.194240.11372@eng.umd.edu> Date: 24 Mar 91 19:42:40 GMT References: <1065@ub.d.umn.edu> <1991Mar24.193356.11251@eng.umd.edu> Sender: news@eng.umd.edu (C-News) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 30 In article <1991Mar24.193356.11251@eng.umd.edu> russotto@eng.umd.edu (Matthew T. Russotto) writes: >I don't know why you would want thousands of integers in a resource-- I would >think a random-access data file would be a better idea, but: > >Type > INTS = array [1..numofints] of Integer; > IntPtr = ^INTS; > IntHandle = ^IntPtr > >Var > ThousInt: Handle; > myints: IntPtr; > > ThousInt = NewHandle (SizeOf(INTS)); >(* I THINK mac pascals all have SizeOf *) > HLock(ThousInt); > myints = IntPtr(ThousInt^) | myints^[1] = whatever; | myints^[2] = whatever; | myints^[3] = whatever; > ... | myints^[numofints] = whatever; | AddResource(Handle(ThousInt), 'Ints', 3838 (* ID # *), 'Name'); note the changes-- it's been too long since I did pascal. Other, less obvious syntactic errors probably included :-) -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu .sig under construction, like the rest of this campus.