Path: news.net.uni-c.dk!noatun.mjolner.dk!mail-to-news From: Jan Atle Ramsli Newsgroups: comp.lang.beta Subject: Please, some critique! Date: Wed, 17 Apr 2002 15:41:52 +0200 Organization: Posted to comp.lang.beta by a mailtonews script Lines: 74 Sender: lbr@mjolner.dk Approved: mailtonews@cs.au.dk Message-ID: NNTP-Posting-Host: bifrost.mjolner.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.net.uni-c.dk 1019055699 11052 130.225.4.254 (17 Apr 2002 15:01:39 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Wed, 17 Apr 2002 15:01:39 +0000 (UTC) Mailing-List: contact usergroup-help@mjolner.dk; run by ezmlm X-No-Archive: yes X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.7-10 i686) X-Accept-Language: en X-Original-Message-ID: <3CBD7BA0.FC426726@skynet.be> X-Original-Sender: atle@picard.skynet.be Xref: news.net.uni-c.dk comp.lang.beta:13205 I need to know when I am 'getting the hang of it' - it feels that way, but Beta is so full of optimizing+clarifying stuff that I am never really sure. I have a main window with three browsers in it, of type TextScrollList, I want to fill them from some 'tables' that are just newline-separated lines containing the text to be displayed on one line in the TextScrollList. The three kinds of items that can be selected, to produce a 'Configuration' that goes in a fourth window, are: Screens - Example: 19" Relisys, Philips 107B 17", ... Printers - Example: TI microWriter 32, HP Deskjet 850C, Olympia 'Electronic', ... Towers - Example: Sun 19" rack, CheapS&ite 13"x7"x15" mini, ... I feel that I did not overdo the subpatterning, because now I can specialze fx. ScreenTableReader to contain subtables, when more choices are available, you may want to just select 'Nokia' and then screen size (17",19",21",25", etc.). And on the Printer side, I could add a comment, like 'TI microWriter will never break', or 'DeskJet 850C please do not use up all the ink, cartridges more expensive than printer', and so on ... But I need to know that I am doing things right from a Beta perspective. I do not want to pick up bad habits that will be had to kick later. THe tables are instantiated on the root level, together with the window, there is no 'table functionality' in any window-subpattern and vice versa. I have learned that this is good Model-View-Controller design, and hope this is still valid :-) So, here it is, I am for safety's sake keeping the Fire Brigade on alert: tablefile: file (# NoSuchFileError::< (# do name->putLine; ' not found'->putLine; false->continue #) #); TableReader: (# t: @TableFile; tn: ^text; open:< (# do INNER ; t.openRead; #); read: (# txt: ^text do (if t.eos then none ->txt[]; leave read else t.getLine->txt[] if) exit txt[] #); close: (# do t.close #) #); TowerTableReader: TableReader (# open::< (# do 'towers.txt'->t.name #) #); PrinterTableReader: TableReader (# open::< (# do 'printers.txt'->t.name #) #); ScreenTableReader: TableReader (# open::< (# do 'screens.txt'->t.name; #); #) -- All done with the mjolner tool, from designing the screens to laying out patterns!!!! It still doesn't like me to do too many very stupid things, but is much more forgiving that previous. Now I can do 10-20 stupid things, before I could do 0-3. Atle (PS Hope I'm not being a total nuisance! PS)