Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!hsdndev!cmcl2!adm!news From: Dave_Wyble.wbst147@xerox.com Newsgroups: comp.lang.pascal Subject: Re: Microsoft mouse event handler Message-ID: <26010@adm.brl.mil> Date: 14 Feb 91 14:13:40 GMT Sender: news@adm.brl.mil Lines: 33 I can't say whether you need to declare you handler as an interrupt, I have only limited experience with mouse.sys and int 33. Technically, your routine is an interrupt handler, your question is really if mouse.sys sets up the IRET or not. I do know that you can't make any dos calls from inside your handler. Notice that whether or not your handler is declared as an interrupt or not, it is still called from an interrupt. As such, no dos calls are allowed. (ie: your writeln, or any other type of IO). You probably got your stack error for this reason; when your handler makes a dos call, dos may get through the call all right, but it never makes it back, because the stack has been trashed. I other words, for your example you need to do something like this: procedure button; begin buttonPressed := true; { global flag } end; begin { main } buttonPressed := false; { set up your handler as before here...} while not buttonPressed do {nothing } writeln('button has been pressed '); { reset the handler } end. Hope this helps some. Dave Wyble Xerox Corp. DRW.Wbst147.Xerox.com (716)422-5293