@@ -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.
@@ -0,0 +1,12 @@
+uses
+ dos;
+ 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');
@@ -0,0 +1,7 @@
+uses sysutils;
+ var r:array[0..3] of real;
+ 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]]));
@@ -0,0 +1,8 @@
+Function Log(const b,r:real):real;
+ log:=ln(r)/ln(b);
+end;
+ log(1,5);
@@ -0,0 +1,44 @@
+const
+ BufSize = 2048;
+var
+ f : file;
+ res : longint;
+ buf : array [0..BufSize-1] of byte;
+ result : word;
+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;
+ blockread(f,buf,sizeof(buf),result);
+ if res<>0 then
+ Writeln('Problem reading executable');
+ close(f)
+ RunError(res);
+ end