next up previous contents index
Next: Compound statements Up: Statements controlling program flow. Previous: The While..do statement

The With statement

The with statement serves to access the elements of a recordgif , without having to specify the name of the record. Given the declaration:

Type Passenger = Record
       Name : String[30];
       Flight : String[10];
       end;

Var TheCustomer : Passenger;
The following statements are completely equivalent:
TheCustomer.Name:='Michael';
TheCustomer.Flight:='PS901';
and
With TheCustomer do
  begin
  Name:='Michael';
  Flight:='PS901';
  end;



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998