mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 23:19:24 +02:00
new files
This commit is contained in:
parent
2b1245e5c1
commit
e320e8610e
14
tests/webtbs/tbug900.pp
Normal file
14
tests/webtbs/tbug900.pp
Normal file
@ -0,0 +1,14 @@
|
||||
program Test;
|
||||
|
||||
uses strings;
|
||||
|
||||
var Str1 : PChar;
|
||||
|
||||
begin
|
||||
GetMem(Str1,256);
|
||||
StrPCopy (Str1, ParamStr(0));
|
||||
writeln ('Arg 0 is "',Str1,'"');
|
||||
StrPCopy (Str1, ParamStr(1));
|
||||
writeln ('Arg 1 is "',Str1,'"');
|
||||
FreeMem(Str1,256);
|
||||
end.
|
12
tests/webtbs/tbug902.pp
Normal file
12
tests/webtbs/tbug902.pp
Normal file
@ -0,0 +1,12 @@
|
||||
uses
|
||||
dos;
|
||||
begin
|
||||
writeln;
|
||||
writeln(fsearch('c:\command.com', ''));
|
||||
{ here you get the full path in BP7, but nothing in FPC }
|
||||
writeln(fsearch('c:\command.com', 'c:\a'));
|
||||
{ I really would not consider this as a bug !! }
|
||||
{ this use of fsearch is not document in BP PM }
|
||||
if fsearch('c:\command.com', '')<>fsearch('c:\command.com', 'c:\a') then
|
||||
Writeln('fsearch result is not BP compatible');
|
||||
end.
|
7
tests/webtbs/tbug909.pp
Normal file
7
tests/webtbs/tbug909.pp
Normal file
@ -0,0 +1,7 @@
|
||||
uses sysutils;
|
||||
var r:array[0..3] of real;
|
||||
begin
|
||||
r[0]:=1; r[1]:=2; r[2]:=3; r[3]:=4;
|
||||
// the following is supposed to print "1, 2, 3, 4", instead it prints "4, 4, 4, 4"
|
||||
writeln(format('%g, %g, %g, %g',[r[0],r[1],r[2],r[3]]));
|
||||
end.
|
8
tests/webtbs/tbug911.pp
Normal file
8
tests/webtbs/tbug911.pp
Normal file
@ -0,0 +1,8 @@
|
||||
Function Log(const b,r:real):real;
|
||||
begin
|
||||
log:=ln(r)/ln(b);
|
||||
end;
|
||||
|
||||
begin
|
||||
log(1,5);
|
||||
end.
|
44
tests/webtbs/tbug912.pp
Normal file
44
tests/webtbs/tbug912.pp
Normal file
@ -0,0 +1,44 @@
|
||||
const
|
||||
BufSize = 2048;
|
||||
|
||||
var
|
||||
f : file;
|
||||
res : longint;
|
||||
buf : array [0..BufSize-1] of byte;
|
||||
result : word;
|
||||
begin
|
||||
assign(f,paramstr(0));
|
||||
{$I-}
|
||||
reset(f,1);
|
||||
res:=IOResult;
|
||||
{$I+}
|
||||
if res=0 then
|
||||
Writeln('It is possible to open the executable in Read/Write mode')
|
||||
else
|
||||
begin
|
||||
filemode:=0;
|
||||
{$I-}
|
||||
reset(f,1);
|
||||
res:=IOResult;
|
||||
{$I+}
|
||||
if res=0 then
|
||||
Writeln('It is only possible to open the executable in Read mode')
|
||||
else
|
||||
Writeln('It is not possible to open the executable in Read mode');
|
||||
end;
|
||||
if res=0 then
|
||||
begin
|
||||
{$I-}
|
||||
blockread(f,buf,sizeof(buf),result);
|
||||
res:=IOResult;
|
||||
{$I+}
|
||||
if res<>0 then
|
||||
Writeln('Problem reading executable');
|
||||
if res=0 then
|
||||
close(f)
|
||||
else
|
||||
RunError(res);
|
||||
end
|
||||
else
|
||||
RunError(res);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user