Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!ncar!gatech!usenet.ins.cwru.edu!ncoast!davewt From: davewt@NCoast.ORG (David Wright) Newsgroups: comp.sys.amiga.programmer Subject: Re: Dumb windows from SAS/C programs on Workbench Message-ID: <1991May17.023000.1652@NCoast.ORG> Date: 17 May 91 02:30:00 GMT References: <1991May14.164909.19186@NCoast.ORG> Organization: North Coast Public Access Un*x (ncoast) Lines: 37 In article fjrei@kbsaar.UUCP (Franz-Josef Reichert) writes: >In article <1991May14.164909.19186@NCoast.ORG> davewt@NCoast.ORG (David Wright) writes: >> On a related note, what do you have to do to kill the CTRL-C trapping >>their startup code puts in by default. I have my own trapper which worked >>fine in Draco programs, but SAS/C seems to grab the signals before I have >>a chance to see them, and is dumping my programs without giving me a chance to >>clean up, close files, etc. > >See your manual P. L-156 to learn more about how to set the break trap to your >favourite function entry. 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 */ } I may have like 4 or 5 of these in various places throughout a single command (in my game), and I want the person to be able to abort the command (not the program) if they decide they have enough, for example when doing a "map 25:1214,820:2015" the person may decide partway through the map the don't need to see any more. Or if they are rebuilding a power report, and it is reading all the planets and is taking a while, they may want to abort the command, but NOT the program. 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. Any ideas why? Dave