Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ub4b!kulcs!icarus.cs.kuleuven.ac.be From: kpottie@icarus.cs.kuleuven.ac.be (Pottie Karl) Newsgroups: comp.sys.mac.programmer Subject: inits & pascal & variables Message-ID: <1652@n-kulcs.cs.kuleuven.ac.be> Date: 30 Jan 91 20:37:01 GMT Sender: news@cs.kuleuven.ac.be Organization: Dept. of Computer Science (K.U.Leuven) Lines: 66 Originator: kpottie@icarus I recently found this file for writing simple inits in Pascal. It worked fine till I tried to use variables unit install; interface procedure main; implementation const YourTrapGoesHere = $A9E9; type long_t = array[0..0] of longint; long_ptr = ^long_t; long_hdl = ^long_ptr; procedure main; var beep: Handle; long: long_hdl; addr: longint; begin beep := Get1Resource('CODE', 128); DetachResource(beep); long := long_hdl(beep); addr := GetTrapAddress(YourTrapGoesHere); long^^[5] := $2F3C; { MOVE.L ,-(A7) } long^^[6] := addr; SetTrapAddress(longint(beep^) + 22, YourTrapGoesHere) end; end. unit beep; interface procedure main; implementation procedure main; begin sysbeep(1); end; end. This all works fine until I try to use variables, like here: unit beep; interface procedure main; implementation procedure main; var ourParam: ParmBlkPtr; begin ourParam^.ioVRefNum := 1; if PBMountvol(ourParam) = noMacDskErr then begin SysBeep(1); end end; end. How can I use variables in an init in Pascal ??