Xref: utzoo comp.sys.mac.programmer:857 comp.sys.mac:16132 Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!ncar!ames!amdahl!apple!han From: han@Apple.COM (Byron Han, fire fighter) Newsgroups: comp.sys.mac.programmer,comp.sys.mac Subject: Re: writing an INIT in LSP Keywords: stupidity, help Message-ID: <10327@apple.Apple.Com> Date: 17 May 88 17:57:31 GMT References: <1930@ssc-vax.UUCP> Reply-To: han@apple.UUCP (Byron Han, fire fighter) Organization: Communication Tools Group - Apple Computer, Inc. Lines: 26 In article <1930@ssc-vax.UUCP> housen@ssc-vax.UUCP (Kevin Housen) writes: > >I am having a problem writing an INIT in Lightspeed Pascal >(version 1.11) on a Mac II. After continual system bombs, >I tried making a really simple INIT - as follows: > Here is an interesting situation. Did you know that when INIT's are called, they are not locked in memory? So, SysBeep which can potentially cause a heap compaction may cause your INIT resource to be relocated. Solution? either set the locked bit in the INIT resource or put this at the start of your INIT. theHandle := RecoverHandle(@EntryPoint); HLock(theHandle); and voila your problems should go away. -- Byron Han, Licensed to Dream. "Macintosh - there is no substitute." Apple Computer, Inc. MS 27Y ------------------------------------- ATTnet:408-973-6450 applelink:HAN1 domain:han@apple.COM MacNET:HAN GENIE:BYRONHAN COMPUSERVE:72167,1664 UUCP:{sun,voder,nsc,decwrl}!apple!han