Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!cbmehq!cbmger!peterk From: peterk@cbmger.UUCP (Peter Kittel GERMANY) Newsgroups: comp.sys.amiga.programmer Subject: Re: Dumb windows from SAS/C programs on Workbench Message-ID: <1231@cbmger.UUCP> Date: 17 May 91 13:18:04 GMT References: <1991May14.164909.19186@NCoast.ORG> <1991May17.023000.1652@NCoast.ORG> Reply-To: peterk@cbmger.UUCP (Peter Kittel GERMANY) Organization: Commodore Bueromaschinen GmbH, West Germany Lines: 35 In article <1991May17.023000.1652@NCoast.ORG> davewt@NCoast.ORG (David Wright) writes: > > This is not what I want to do. I am quite familiar with the >"onbreak()" type calls, but that is not how I want to handle the >events. What *I* want to do is more like this: > > while(!gotError && !gotUserBreak()) > { > /* code here */ > } > > So basically what I want is something that will evaluate down to a >logical true or false if the user has pressed CTRL-C (or some other >control character the operator has decided to allow). Under Draco you could >do this very simply by &'ing bits with SIGBRKF_C, but this same method, >although it compiles fine, appears to do nothing under SAS/C. Yes, the SIGBRKF_C is also the right method in C. You must use the function SetSignal: while((SetSignal(0L,0L) & SIGBREAKF_CTRL_C)==0) { ... } And to disable the Lattice own Ctrl-C checking, insert following lines at start: #ifdef LATTICE int CXBRK() { return(0); } int chkabort() { return(0); } #endif This can also be found at some places in the blue 1.3 RKM's (although there you only find the first function, I think, the above version is from a posting by Richard Leinfellner in the developer's newsgroup). -- Best regards, Dr. Peter Kittel // E-Mail to \\ Only my personal opinions... Commodore Frankfurt, Germany \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk