Path: news.cs.au.dk!news.net.uni-c.dk!howland.erols.net!skynet.be!poster!not-for-mail From: Atle Newsgroups: comp.lang.beta Subject: Program 'betcat.bet': Comments, please? Date: Tue, 20 Jun 2000 15:23:16 -0100 Organization: Belgacom Skynet SA/NV Lines: 54 Message-ID: <394F9A74.3AB6FE7D@skynet.be> References: <394D2663.37AB97D4@skynet.be> NNTP-Posting-Host: dialup138.charleroi.skynet.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news1.skynet.be 961507116 18847 195.238.7.138 (20 Jun 2000 13:18:35 GMT) X-Complaints-To: abuse@skynet.be NNTP-Posting-Date: 20 Jun 2000 13:18:35 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:12458 Now, I have gotten my betcat.bet program to work, it terminates gracefully when there is noSuchFile, and correctly cats the contents to the screen. My request now is just for comments on style, errors that don't show up easily, anything you can think of that I should know about. I don't want to be developing bad habits when starting with a new language. betcat.bet is given below. Thanks, Atle ORIGIN '~beta/basiclib/betaenv'; INCLUDE '~beta/basiclib/file'; -- Program : Descriptor -- (# i : @integer; showFile : (# OK : @Boolean; fileName: ^text; fil: @File (# accessError:: (# do false -> OK #); noSuchFileError:: (# do true ->continue ; false -> OK #); otherError:: (# do false -> OK #) #); enter fileName[] do TRUE -> OK; fileName[] -> fil.Name; fil.openRead; (if not OK then 'Can\'t open file ' -> putText; fileName[] -> putLine; leave showFile else 'Contents of ' -> putText; fileName[] -> putLine; if); readTheFile: (# do (if not fil.eos then fil.getline -> putLine; restart readTheFile else fil.Close; '' -> fil.Name; leave readTheFile if); #); #) do (for i:noOfArguments-1 repeat i+1 -> arguments -> showFile for) #)