(* Collection of code snippets by Arne Vajhøj *)
(* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) *)
[inherit('sys$library:starlet','sys$library:pascal$lib_routines')]

program isq1(input,output);

type
   string = varying [255] of char;
   fixstring = packed array [1..8] of char;
   isqrec = record
               keyfield  : [KEY(0)] fixstring;
               bodyfield : string;
            end;

var
   isqf : file of isqrec;
   fnm : string;
   table : integer;

begin
   table:=LIB$K_CLI_GLOBAL_SYM;
   lib$get_symbol('WWW_PATH_INFO',fnm.body,fnm.length,table);
   fnm:=substr(fnm,2,length(fnm)-1);
   open(isqf,fnm,readonly,access_method:=sequential,organization:=indexed);
   reset(isqf);
   writeln('content-type: text/html');
   writeln;
   writeln('<HTML>');
   writeln('<HEAD>');
   writeln('<TITLE>',fnm,'</TITLE>');
   writeln('</HEAD>');
   writeln('<BODY>');
   writeln('<PRE>');
   while not(eof(isqf)) do begin
      writeln('<A HREF="/htbin/runisq2/',fnm,'/',isqf^.keyfield,'">',isqf^.keyfield,'</A>');
      get(isqf);
   end;
   writeln('</PRE>');
   writeln('</BODY>');
   writeln('</HTML>');
   close(isqf);
end.
