All pastes #994359 Raw Edit

Miscellany

public text v1 · immutable
#994359 ·published 2008-04-23 10:50 UTC
rendered paste body
  assign(dbfile, 'database.dbin');
    {$i-}
    reset(dbfile);
    if IOresult <> 0
      then
        begin//file not found
          writeln('Duomenu bazes failas "database.dbin" neegzistuoja. Sukurti? (t/n)[t]');
          readln(newf);
            if newf = 'n'
              then
                begin
                  writeln('Programa baigia darba');
                  readln; halt;
                end
              else
                begin
                  close(dbfile);
                  rewrite(dbfile);
                  reset(dbfile);
                end;
        end;//file not found - FIXED!!!
    if sizeof(dbfile) > 10
      then begin
        close(dbfile);
        readfile(globaldb);
         end
      else close(dbfile);