No subject


Mon Sep 26 12:49:38 CEST 2005


Changes were required within Texts.Mod to the Writeint procedure 
to correct mismatched columns in the more complete directory display.
Apparently the whitespace char in Oberon#.Scn.Fnt's are only
one-half a char wide (in pixels).  To maintain straight columns when 
writing integers to the screen this requires a double-space for each 
char the integer is shorter than the default (the 6 above in the
System.Mod code).

(** Write integer x to W's buffer. Spaces are padded to the left until the 
number field is at least n characters long. *)
PROCEDURE WriteInt* (VAR W: Writer; x, n: LONGINT);
    VAR i, x0: LONGINT;
      a: ARRAY 10 OF CHAR;
  BEGIN i := 0;
    IF x < 0 THEN
      IF x = MIN(LONGINT) THEN WriteString(W, " -2147483648"); RETURN
      ELSE DEC(n); x0 := -x
      END
    ELSE x0 := x
    END;
    REPEAT
      a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i)
    UNTIL x0 = 0;
    n := (n-i )* 2;	(* newcode CPA *)
(*    WHILE n > i DO Write(W, " "); DEC(n) END;  original code CPA*)
    WHILE n > 0 DO Write(W, " "); DEC(n) END;	(* newcode CPA *)
    IF x < 0 THEN Write(W, "-") END;
    REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0
  END WriteInt;

After making the above changes to System.Mod and Texts.Mod,
recompiling and a reboot:

System.Directory *\d

Gives this dispaly:

 10.08.2002 06:33:25	   7330	ASCIITab.Obj
 10.08.2002 06:33:25	    455	ASCIITab.Tool
 14.08.2002 04:31:56	  36985	ASPI.Mod
 07.08.2002 05:54:58	  18190	ASPI.Obj
 14.08.2002 04:31:57	  48874	ATADisks.Mod
 07.08.2002 05:54:59	  20348	ATADisks.Obj
 14.08.2002 04:31:58	  63047	Adaptec7.Mod
 
 Star mark the frame and use:
 
Sort.Sort *\r	in reverse order

To get this display:

1069 files use 25MB
 17.08.2002 03:36:19	    5078	Mail.Panel
 17.08.2002 03:34:53	    5109	Mail.Panel.Bak
 17.08.2002 02:49:09	    1696	MailMessages
 17.08.2002 02:48:55	     971	Mail.Out.Text
 17.08.2002 02:40:56	    1032	Mail.Out.Text.Bak
 17.08.2002 02:28:45	   28950	Oberon.Text
 16.08.2002 04:00:11	    2303	Oberon10.Scn.Fnt
 16.08.2002 03:55:25	    2303	Ob10.Scn.Fnt
 16.08.2002 03:55:09	    2003	Ob8.Scn.Fnt
 16.08.2002 03:46:26	    4270	System.Tool
 15.08.2002 10:23:02	   93012	URL.DB.Bak
 15.08.2002 03:25:27	   28931	Oberon.Text.Bak
 
 Even the numbers of files and total file size appear at the top
 as an added `bonus'! :-)
 
 The standard filenames-only display is not altered by any of these
 modifications btw.
 
 With these minor adjustments to the two Modules, Finding the 
 most recently changed files is facilitated and the straightened 
 columns give Oberon a better overall appearance IMO.
 
 When using DOS.Directory there is a problem with how Oberon 
 is interpreting the TAB char "9X" but I haven't looked into that
 problem - yet. ;-)
 
 Is the Linux version doing straight columns when accessing the
 Linux directories or is this TAB interpretation much the same for
 all versions of ETH N-O?
 
 

Charles Angelich

The Ghost in the Machine!

DOS and W31 Tech website:
http://www.undercoverdesign.com/dosghost

Stories, poems, music, and photos website:
http://www.undercoverdesign.com/dosghost/faf





More information about the Oberon mailing list