Previous: While Statement To the Table of Content Next: Programs and Units

- 2.2.9.12 -
TMT Pascal Language Description
Pascal Language Structure
Statements

With Statement

The with statement allows one to refer to the fields of a record type as if they were independent variables. with takes the following form:
with variable [, variable] do statement
where variable refers to a record type. Statement may refer to the fields of variable without specifying the variable name.

The following is an example of the with statement:
type
  ScreenString = record
    x, y: Integer;
    str : String;
end;

var
  ScrnSay : ScreenString;
begin
  with ScrnSay do
    begin
      x  := 5;
      x  := 5;
      y  := 10;
      str:= 'Hello World!';
    end;
end.



Previous: While Statement To the Table of Content Next: Programs and Units
While Statement Table of Content Programs and Units

- 2.2.9.12 -