Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!uw-beaver!cornell!rochester!pt.cs.cmu.edu!cadre!pitt!unix.cis.pittsburgh.edu!adams3 From: adams3@unix.cis.pittsburgh.edu (Larry Adams) Newsgroups: comp.sys.mac.programmer Subject: Alert problems Message-ID: <18282@unix.cis.pittsburgh.edu> Date: 5 Jun 89 01:56:49 GMT Reply-To: adams3@unix.cis.pittsburgh.edu (Larry Adams) Distribution: usa Organization: Univ. of Pittsburgh, Comp & Info Sys Lines: 29 I'm a fairly novice mac programmer; in fact, the program i'm working on is my first for the mac. i seem to be having a problem with memory, and would like the group's collective wisdom. my program uses a "cursor" based linked list data structure. (no flames please, it'll be changed to a dynamic structure, but i don't think that'll affect the problem at hand.) i initialize it by a call to NewHandle (i.e., myHndl := structHndl(NewHandle(sizeof(structArray))) ) the user can then create up to three lists (with windows which would display them). i used to pass NIL as the wStorage value, but kept getting the THINK pascal error "Address Error". when i used a variable to store the windows (actually, an array of three elements, i.e., @wStore[i] ), my problem went away. however, when the user has created their three lists ( ==> windows), i want to put up an alert, saying that they must close one before opening another. i'm using StopAlert. however, i again get "Address Error". I'm assuming that if i use a dialog & use ModalDialog, then i won't have the problem, since i can pass a pointer to storage for the dialog window. my question is, why, when i have ~20 K free memory (as reported by MemAvail), would i get an address error? have i done anything seriously wrong, or overlooked something that should be obvious? if this is too trivial a question, please send your answer by e-mail. your help is greatly appreciated, since i'm trying to learn, and i don't know any mac hackers here at pitt. larry adams