Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!tramp!hartkopf From: hartkopf@tramp.Colorado.EDU (Jeff Hartkopf) Newsgroups: comp.sys.apple Subject: ORCA/C question Message-ID: <10502@boulder.Colorado.EDU> Date: 4 Aug 89 21:43:41 GMT Sender: news@boulder.Colorado.EDU Reply-To: hartkopf@tramp.Colorado.EDU (Jeff Hartkopf) Organization: University of Colorado, Boulder Lines: 96 I'm having a problem in loading/starting Standard File from an NDA with Orca/C. I previously wrote the code to do this in TML Pascal, and it worked, so I just translated that as much as I could into C, but now it doesn't work. I know there is an error somewhere in the code below, but I'm not sure where--maybe someone could look at it and see if they can spot an (or more than one?) error. I marked one place with a comment where I wasn't sure if that line was right, but since there were no examples of this on the Orca/C samples disk, I'm not sure. Thanks very much for any help. /* in the NDA Open function: */ handle toolsZeroPage; int toolErr; BOOLEAN NDAStartedSF = FALSE; /* records if this NDA started SF or not */ BOOLEAN NDALoadedSF = FALSE; /* records if this NDA loaded SF or not */ word memID; int btn; if (!SFLoaded()) /* SFLoaded() code is shown below */ { memID = MMStartUp(); /* possibly error in following line? */ toolsZeroPage = NewHandle(256, memID, attrBank + attrPage + attrFixed + attrLocked); do LoadOneTool(23, 0); toolErr = toolerror(); if (toolErr) { btn = TLMountVolume(100, 40, "Error loading tools", "Insert System Disk", "OK", "Cancel"); if (btn != 1) SysFailMgr(toolErr, "Unable to load tools"); } } while (toolErr); NDALoadedSF = TRUE; } if (!SFStarted()) /* SFStarted() code is shown below */ { SFStartUp(memID, *toolsZeroPage); NDAStartedSF = TRUE; } /* ... some actions, etc. */ if (NDAStartedSF) SFShutDown(); if (NDALoadedSF) { UnloadOneTool(23); DisposeHandle(toolsZeroPage); } /* SFLoaded() and SFStarted(): */ BOOLEAN SFLoaded(void) /* returns TRUE if Standard File is loaded, otherwise FALSE */ { SFStatus(); if (toolerror()) /* not loaded */ return (FALSE); else /* loaded */ return (TRUE); } BOOLEAN SFStarted(void) /* returns TRUE if Standard File is started, otherwise FALSE */ { int started; started = SFStatus(); if (toolerror()) /* not even loaded, so not started */ return (FALSE); else if (!started) /* not started */ return (FALSE); else return (TRUE); /* started */ } Also, is anyone else having problems running Orca/C from System Software 5.0? I have 1.25 meg of memory, and when I run it from my hard drive, and try to compile something, I generally get a strange empty dialog box and the system hangs. Is this a memory problem, or just an incompatibility problem, with 5.0? Thanks for any suggestions. Jeff Hartkopf Internet: hartkopf@tramp.Colorado.EDU