Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!cornell!uw-beaver!mit-eddie!bu-cs!mirror!rayssd!galaxia!amanpt1!mrr From: mrr@amanpt1.zone1.com (Mark Rinfret) Newsgroups: comp.sys.mac.programmer Subject: Need help with INITs Keywords: pop,bang,crash,huh? Message-ID: <541@amanpt1.zone1.com> Date: 9 Jan 89 18:32:25 GMT Organization: HyperView Systems Lines: 67 I've just recently started exploring INIT's and didn't get very far before I ran into a snag. When the following small init program is run, it gets a System Error 10 (line F emulator trap) on the InitWindows call. As you can see, I have commented out subsequent portions of the code. I discovered that the InitWindows call was failing by first commenting out everything between the BEGIN/END and incrementally turning statements back on. Hopefully I've provided enough info here. I added a 'sysz' resource, thinking there might be a heap space problem, but playing with various sizes (up to 64K) did no good. This problem is only the tip of a much bigger iceberg, but my inability to solve it has left me quite annoyed. I have all five volumes of Inside Macintosh, plus the revised edition of Macintosh Revealed, yet I feel that there is "some other documentation" (just ordered all tech notes) that would help me with this. Can anyone give me any clues? Thanks. UNIT InitUnit; INTERFACE USES {$LOAD StdLib.load} MemTypes, Quickdraw, OSIntf, ToolIntf, PackIntf {$LOAD} ; PROCEDURE InitMain; IMPLEMENTATION PROCEDURE InitMain; CONST SHIFT_KEY = 56; VAR keys: KeyMap; myQDVars: RECORD { Can't have globals, so we use this... } private: PACKED ARRAY [0..75] OF Char; randSeed: LongInt; screenBits: BitMap; Arrow: Cursor; dkGray: Pattern; ltGray: Pattern; gray: Pattern; black: Pattern; white: Pattern; thePort: GrafPtr; END; result: INTEGER; BEGIN { InitMain } GetKeys(keys); IF NOT keys[SHIFT_KEY] THEN BEGIN InitGraf(@myQDVars.thePort); InitFonts; InitWindows; {InitMenus;} {TEInit;} {InitDialogs(NIL);} {result := CautionAlert(256, NIL);} END; END; { InitMain } END. { InitUnit } -- < Mark R. Rinfret, mrr@amanpt1.ZONE1.COM | ...rayssd!galaxia!amanpt1!mrr > < HyperView Systems Corp. Home: 401-846-7639 > < 28 Jacome Way Work: 401-849-9390 x301 > < Middletown, RI 02840 Hypermedia R Us! >