Previous: 2.2.9.11. While Statement To the Table of Contents Next: 2.2.10. Programs and Units
2.2.9.11. While Statement Table of Contents 2.2.10. Programs and Units

- 2.2.9.12. -
Table of Contents
2. TMT Pascal Language Description
2.2. Pascal Language Structure
2.2.9. Statements
2.2.9.12. With Statement


2.2.9.12. 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: 2.2.9.11. While Statement To the Table of Contents Next: 2.2.10. Programs and Units
2.2.9.11. While Statement Table of Contents 2.2.10. Programs and Units

- 2.2.9.12. -