
program visfile;   { }

const n_campi=45;
      stlen=25;
      release='rel. 0 rev. 1';
      c1='0';
      c2='Z';
      const n_tab=20;
      int_len=12;
      r_u=6; r_d=4;
      default_help='help.pag';
      message_line=25;


TYPE
        strc=string[stlen];
        str8=string[8];
        str10=string[10];
        str12=string[12];
        str20=string[20];
        str25=string[25];
        str30=string[30];
        str50=string[50];
        str80=string[80];
        str160=string[160];
        str320=string[240];

        DosRec = record
          ax,bx,cx,dx,bp,si,di,ds,es,flags:integer;
        end;

        type  Clock = record
          hour,minute,second:integer;
        end;

      Calendar = record
        day,month,year:integer;
      end;

      recbyte=record
        ah,al,bh,bl,dh,dl:byte;
        bp,si,di,ds,es,flags:integer;
      end;

      str3=string[3];

      boo=boolean;
var
    tab                       :array[1..n_tab] of strc;
    editor                    :file;
    data,articolo             :strc;
    tastog                    :char;
    bu:byte;
    testo                     :str80;
    name                      :str12;
    nfr,nfm,help_file         :str12; {name for filr ricette (nfr) and moduli }
    ok,secret,level3,level4   :boo;
    debug                     :boo;
    i,int,m_line              :integer;
    config                    :file of byte;

    time:integer;


{procedure setkey;
EXTERNAL 'SETKEY.EXE';}


{$C-,I-,K-}

{$i dostool.box}

procedure end_but_reside;
var dos:dosrec;
begin
  dos.dx:=$2d7e;
  intr($31,dos);
end;

{$I TOOL}



procedure new_proc;

var dos:dosrec;
begin

  intr($19,dos);
end;
{---------------------------end of tool box-------------------------}

function GetDefaultDrive: char;
type
      DosRec = record
        ax,bx,cx,dx,bp,si,di,ds,es,flags:integer;
      end;

var disk: DosRec;
begin
  disk.AX:=$1900;        { Set AH to $19 to call read_default_drive function }
  intr($21,disk);                                       { Call interrupt $21 }
  GetDefaultDrive:=upcase(chr((disk.AX and $FF) + 65)); {AL = #; 0 = 'A'; 1 = 'B' ...}
end;  { GetDefaultDrive }


procedure SetDefaultDrive(name: char);
type
      DosRec = record
        ax,bx,cx,dx,bp,si,di,ds,es,flags:integer;
      end;
var disk: DosRec;
begin
  name:=upcase(name);
  disk.DX:=ord(name) - 65;        { Set DX to drive #; 0 = 'A'; 1 = 'B' ... }
  disk.AX:=$0E00;              { Set AH to $0E to call select_disk function }
  intr($21,disk);                                      { Call interrupt $21 }
end;  { SetDefaultDrive }


begin
  debug:=false;
  menu(1,'                   Visfile');
  name:='';
  get_name(10,10,'Nome del file da visionare?',name);

  assign(config,name);
  menu(1,'VISUALIZZAZIONE DATI');
  gotoxy(1,2);
  if esiste(name) then
    begin
      reset(config);
      while not(eof(config)) do
        begin
          read(config,bu);
          if bu<>7 then
            write(chr(bu),bu,' ')
          else
            write('* 07 ');
          stand_by;

        end;
      close(config);
    end
  else
    centre_wait(10,'Non esiste il file');

  tastog:='n';
  get_chr(10,10,'Vuoi resettare il sistema(s=s)?',tastog);
  if upcase(tastog)='S' then
    new_proc;
   { end_but_reside;}
end.