Path: news.cs.au.dk!news.net.uni-c.dk!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!skynet.be!poster!not-for-mail From: Atle Newsgroups: comp.lang.beta Subject: Re: program 'cat.bet': Suggested implementation? Date: Tue, 20 Jun 2000 14:59:11 -0100 Organization: Belgacom Skynet SA/NV Lines: 64 Message-ID: <394F94CF.646BAA91@skynet.be> References: <394D2663.37AB97D4@skynet.be> <8ijcf8$7o4o$1@xinwen.cs.au.dk> NNTP-Posting-Host: dialup293.charleroi.skynet.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news1.skynet.be 961505673 18499 194.78.236.165 (20 Jun 2000 12:54:33 GMT) X-Complaints-To: abuse@skynet.be NNTP-Posting-Date: 20 Jun 2000 12:54:33 GMT X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i686) X-Accept-Language: en Xref: news.cs.au.dk comp.lang.beta:12456 Jorgen Lindskov Knudsen wrote: > > > > The correct program part is: > > fil: @file(# accesserror:: (# do false->OK #); > nosucherror:: (# do false->OK #); > othererror:: (# do false->OK #); > #); > ... > true->OK; > fil. openread; > ... Now, I tried experimenting with this, adding statements to the exception. fil: @file(# accesserror:: (# do false->OK #); noSuchFileError:: (# do false->OK; true->continue #); othererror:: (# do false->OK #); #); ... true->OK; fil. openread; if ( NOT OK then ' error' -> putLine; leave showFile if); ... so fra, OK. Calling betcat (I call the program betcat to not confuse with the operating system cat, had some weird 'bugs' :-) like this is OK, assuming betcat.bet exists and ls.bet does not: $betcat betcat.bet ls.bet error $ Now, let us say I want the specific error: access error no such file error other error and so on. i did this: fil: @file(# accesserror:: (# do false->OK; true->continue; 'Access' -> putText #); noSuchFileError:: (# do false->OK; true->continue; 'No such file' -> putText #); othererror:: (# do false->OK; true ->continue; 'Other' ->putText #); #); ... true->OK; fil. openread; if ( NOT OK then ' error' -> putLine; leave showFile if); ... The program logic would the suggest this: $betcat betcat.bet ls.bet No such file error $ However, it says 'reference is none' and i guess educatedly :-) that is is the 'No such file' string which is none. But I am raised to believe that a '' delimited string can never be none, because it is a constant. What are the restrictions on which objects are valid in an exception? Or did i do something else wrong? Thanks, Atle