Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.2.0 / tests / webtbs / tw25932.pp
Size: Mime:
{$mode delphi}

uses
  sysutils;

procedure testfile;
var
  f: file;
  s: shortstring;
  a: ansistring;
  u: unicodestring;
begin
  s:='a';
  a:='b';
  u:='c';

  fillchar(f,sizeof(f),0);
  try
    erase(f);
  except
    on e: EInOutError do
     if e.ErrorCode<>102 then
       raise
  end;

  fillchar(f,sizeof(f),0);
  try
    rename(f,s);
  except
    on e: EInOutError do
     if e.ErrorCode<>102 then
       raise
  end;

  fillchar(f,sizeof(f),0);
  try
    rename(f,a);
  except
    on e: EInOutError do
     if e.ErrorCode<>102 then
       raise
  end;

  fillchar(f,sizeof(f),0);
  try
    rename(f,u);
  except
    on e: EInOutError do
     if e.ErrorCode<>102 then
       raise
  end;
end;

procedure testtext;
var
  f: text;
  s: shortstring;
  a: ansistring;
  u: unicodestring;
begin
  s:='a';
  a:='b';
  u:='c';

  fillchar(f,sizeof(f),0);
  try
    erase(f);
  except
    on e: EInOutError do
     if e.ErrorCode<>102 then
       raise
  end;

  fillchar(f,sizeof(f),0);
  try
    rename(f,s);
  except
    on e: EInOutError do
     if e.ErrorCode<>102 then
       raise
  end;

  fillchar(f,sizeof(f),0);
  try
    rename(f,a);
  except
    on e: EInOutError do
     if e.ErrorCode<>102 then
       raise
  end;

  fillchar(f,sizeof(f),0);
  try
    rename(f,u);
  except
    on e: EInOutError do
     if e.ErrorCode<>102 then
       raise
  end;
end;

begin
  testfile;
end.