Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site trwrba.UUCP Path: utzoo!linus!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!trwrb!trwrba!carlile From: carlile@trwrba.UUCP (Donald E. Carlile) Newsgroups: net.micro.mac Subject: Re: HELP!!! Message-ID: <1772@trwrba.UUCP> Date: Tue, 7-Jan-86 13:45:39 EST Article-I.D.: trwrba.1772 Posted: Tue Jan 7 13:45:39 1986 Date-Received: Thu, 9-Jan-86 05:59:01 EST References: <430@ssc-vax.UUCP> Reply-To: carlile@trwrba.UUCP (Donald E. Carlile) Distribution: net Organization: TRW EDS, Redondo Beach, CA Lines: 50 In article <430@ssc-vax.UUCP> keith@ssc-vax.UUCP (Keith Nemitz) writes: > > Could I have a round of "yes ModalDialog works as advertized" back at me. Yes ModalDialog works! >I can't for the life of me figure out why the following code kills me with >error message #2. > > begin > myDialog := GetNewDialog(DResNum,ADR(dRec),NIL); > repeat > ModalDialog(NIL,Item); > until Item = 1; > end > > help! > Keith Nemitz > uw-beaver!ssc-vax!keith > A9F4 I have similar code that works. It goes like this: begin dialogP := GetNewDialog(whichDialog,NIL,pointer(-1)); . . repeat ModalDialog(nil,dItem); . . As you can see, our calls to ModalDialog are essentially identical. The difference must be in the GetNewDialog call. The differences there occur in where the dialog is stored and which window it appears behind. You have chosen to provide space for the dialog. The NIL in my code places it on the heap. Although I'm not positive, if the address you provide is not on the correct boundary, you could get error 2. The other difference is that you use NIL to indicate where you want the dialog drawn. IM specifies the pointer(-1) in order to put the dialog on top. I hope this helps. Don Carlile ...inhp4!trwrb!trwrba!carlile DISCLAIMER: The opinons expressed here are not neccessarily those of my employer.