Test suite results for test file tbs/tb0084.pp

Test run data :

Free Pascal Compiler Test Suite Results

View Test suite results

Please specify search criteria:
File:
Operating system:
Processor:
Version
Date
Submitter
Machine
Comment
Limit
Cond
Category
Only failed tests
Hide skipped tests
List all tests

Test file "tbs/tb0084.pp" information:

t_id 333
t_adddate 2003/10/03
t_result 0
t_knownrunerror 0

Detailed test run results:

Record count: 50

Total = 50

OK=50 Percentage= 100.00

Result type Cat. Count Percentage First date Last Date
Successfully run 50 100.0 2024/05/21 01:40:00 15 2024/05/21 06:02:00 29
i386 8 16.0 2024/05/21 01:52:00 47 2024/05/21 06:01:00 28
m68k 1 2.0 2024/05/21 05:47:00 63 2024/05/21 05:47:00 63
sparc 1 2.0 2024/05/21 04:50:00 56 2024/05/21 04:50:00 56
arm 1 2.0 2024/05/21 05:53:00 67 2024/05/21 05:53:00 67
x86_64 17 34.0 2024/05/21 01:40:00 15 2024/05/21 06:00:00 29
powerpc64 14 28.0 2024/05/21 04:20:00 53 2024/05/21 05:49:00 112
mips 1 2.0 2024/05/21 05:57:00 160 2024/05/21 05:57:00 160
aarch64 6 12.0 2024/05/21 04:37:00 35 2024/05/21 06:02:00 29
riscv64 1 2.0 2024/05/21 04:44:00 30 2024/05/21 04:44:00 30
linux 38 76.0 2024/05/21 01:40:00 15 2024/05/21 06:00:00 175
win32 2 4.0 2024/05/21 04:53:00 28 2024/05/21 06:01:00 28
go32v2 2 4.0 2024/05/21 04:56:00 56 2024/05/21 05:41:00 55
solaris 4 8.0 2024/05/21 03:16:00 19 2024/05/21 06:00:00 29
darwin 4 8.0 2024/05/21 05:42:00 24 2024/05/21 06:02:00 29
3.3.1 25 50.0 2024/05/21 01:40:00 15 2024/05/21 06:02:00 29
3.2.3 25 50.0 2024/05/21 01:52:00 47 2024/05/21 06:01:00 28

Source:

{ Old file: tbs0098.pp }
{ File type casts are not allowed (works in TP7)        OK 0.99.1 (FK) }

program Test;
{ Show how to seek to an OFFSET (not a line number) in a textfile, }
{ without using asm. Arne de Bruijn, 1994, PD }
uses Dos; { For TextRec and FileRec }
var
 F:text;
 L:longint;
 S:string;
begin
 assign(F,'tbs/tb0084.pp');           { Assign F to itself }
 reset(F);                             { Open it (as a textfile) }
 ReadLn(F);                            { Just read some lines }
 ReadLn(F);
 ReadLn(F);
 FileRec((@F)^).Mode:=fmInOut;         { Set to binary mode }
  { (The (@F)^ part is to let TP 'forget' the type of the structure, so }
  {  you can type-caste it to everything (note that with and without (@X)^ }
  {  can give a different value, longint(bytevar) gives the same value as }
  {  bytevar, while longint((@bytevar)^) gives the same as }
  {  longint absolute Bytevar (i.e. all 4 bytes in a longint are readed }
  {  from memory instead of 3 filled with zeros))) }
 FileRec((@F)^).RecSize:=1;            { Set record size to 1 (a byte)}
 L:=(FilePos(File((@F)^))-TextRec(F).BufEnd)+TextRec(F).BufPos;
{... This line didn't work the last time I tried, it chokes on the "File"
typecasting thing.}

  { Get the fileposition, subtract the already readed buffer, and add the }
  { position in that buffer }
 TextRec(F).Mode:=fmInput;             { Set back to text mode }
 TextRec(F).BufSize:=SizeOf(TextBuf);  { BufSize overwritten by RecSize }
                                       { Doesn't work with SetTextBuf! }
 ReadLn(F,S);                          { Read the next line }
 WriteLn('Next line:',S);              { Display it }
 FileRec((@F)^).Mode:=fmInOut;         { Set to binary mode }
 FileRec((@F)^).RecSize:=1;            { Set record size to 1 (a byte)}
 Seek(File((@F)^),L);                  { Do the seek }
{... And again here.}

 TextRec(F).Mode:=fmInput;             { Set back to text mode }
 TextRec(F).BufSize:=SizeOf(TextBuf);  { Doesn't work with SetTextBuf! }
 TextRec(F).BufPos:=0; TextRec(F).BufEnd:=0; { Reset buffer counters }
 ReadLn(F,S);                          { Show that it worked, the same }
 WriteLn('That line again:',S);        { line readed again! }
 Close(F);                             { Close it }
end.

Link to SVN view of tbs/tb0084.pp source.