Previous: User Defined Operators To the Table of Content Next: User Defined Writer Procedure

- 2.2.17 -
TMT Pascal Language Description
Pascal Language Structure

User Defined Reader Procedure

TMT Pascal compiler allows one to define a reader procedure for ones own types including objects and structures by means of the __reader reserved word. The syntax of the custom reader procedure is the following:
procedure __reader (var f: text; const value: <Custom Type>);
begin
  ...
end;
The __reader example below showed the use of a DateTime structure defined in the DOS unit. This code reads a date using the Read procedure:
{$ifdef __GUI__}
  uses DOS, WinCRT;
{$else}
  uses DOS;
{$endif}

procedure __reader (var f: text; const value: DateTime);
begin
  Read(f, value.Month, value.Day, value.Year);
end;
 
var
  date: DateTime;

begin
  Read(date);
end.
See also:
User Defined Writer Procedure


Previous: User Defined Operators To the Table of Content Next: User Defined Writer Procedure
User Defined Operators Table of Content User Defined Writer Procedure

- 2.2.17 -