TIP: Click on subject to list as thread! ANSI
echo: z3_pascal
to: Eric Tam
from: Keith Bolland
date: 1996-06-26 07:01:36
subject: That code segment

Greetings, Eric...

procedure getcfg;                                    { Reads the config file }
var cfg        : text;
    pstr       : pathstr;
    l,lala     : string;
    numorigins,
    cfglines,
    la         : integer;
begin
     pstr := fsearch(pcfg,getenv('PATH'));
     if (pstr = '') and (fileexists(pcfg) = false) then
        error(3)
     else
        if pstr  '' then assign(cfg,fexpand(pstr))
           else assign(cfg,pcfg);
     reset(cfg);
     cfglines := 0;
     oc := 1;
     while not eof(cfg) do
     begin
          readln(cfg,l);
          if copy(l,1,7) = 'Origin ' then
          begin
               if length(l) > omlen then origins[oc] := copy(l,8,omlen)
                  else origins[oc] := copy(l,8,length(l));
               writeln(' Using origin: ',origins[oc]);
               inc(oc);
          end;
     end;
     close(cfg);
end;

procedure randorigin;
var
   infile,outfile : text;
   l,la : string;

begin
     assign(infile,paramstr(1));
     assign(outfile,paramstr(2));
     reset(infile);
     rewrite(outfile);
     while not eof(infile) do
     begin
          la := origins[random(oc)+1];
          readln(infile,l);
          if copy(l,1,4) = '--- ' then l := l + tearadd;
          writeln(outfile,l);
     end;
     writeln(' Chosen origin: ',la);
     close(infile);
     close(outfile);
end;

  -- Keith...
... All that glitters has a high refractive index.
--- timEd/2-B11, OrigRand
if copy(l,1,19) = ' * Origin: !!RAND!!' then
l := ' * Origin: ' + la + ' '+ copy(l,21,length(l));
* Origin: ...by means of a blunt instrument, to whit, a Dragon (3:771/160.41)
SEEN-BY: 633/267 270
@PATH: 771/160 772/20 712/624 517 515 711/808 50/99 635/544 727 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.