~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to docs/sysutex/ex37.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Program Example37;
2
 
 
3
 
{ This program demonstrates the FileCreate function }
4
 
 
5
 
Uses sysutils;
6
 
 
7
 
Var I,J,F : Longint;
8
 
 
9
 
Begin
10
 
  F:=FileCreate ('test.dat');
11
 
  If F=-1 then 
12
 
    Halt(1);
13
 
  For I:=0 to 100 do
14
 
    FileWrite(F,I,SizeOf(i));
15
 
  FileClose(f);
16
 
  F:=FileOpen ('test.dat',fmOpenRead);
17
 
  For I:=0 to 100 do
18
 
    begin
19
 
    FileRead (F,J,SizeOF(J));
20
 
    If J<>I then
21
 
      Writeln ('Mismatch at file position ',I)
22
 
    end;
23
 
  FileSeek(F,0,fsFromBeginning);
24
 
  Randomize;
25
 
  Repeat
26
 
    FileSeek(F,Random(100)*4,fsFromBeginning);
27
 
    FileRead (F,J,SizeOf(J));
28
 
    Writeln ('Random read : ',j);
29
 
  Until J>80;
30
 
  FileClose(F);
31
 
  F:=FileOpen('test.dat',fmOpenWrite);
32
 
  I:=50*SizeOf(Longint);
33
 
  If FileTruncate(F,I) then
34
 
    Writeln('SuccessFully truncated file to ',I,' bytes.');
35
 
  FileClose(F);
36
 
End.
 
 
b'\\ No newline at end of file'