content_image/725888.jpg
## 7.C. The With Statement 

P.Name.Last := 'Whitcomb P.Name.First := 'William P.Height := 186; P.Sex := Male; P.Birth.Year := 1951; , . , . , P.Birth.Mo := Sep; P.Birth.Day .= 12; P . Depdt s : = 1; P.MS := Single; 

The above notation can be a bit tedious, and you may wish to abbreviate it using the with statement. The with statement effectively opens the scope containing the field identifiers of the specified record variable, so that the field identifiers may occur as variable identifiers (thereby providing an opportunity for the Pascal compiler to optimize the qualified statement). The general fonn is: 

<img src='content_image/725888.jpg'>

Within the qualified statement of the with statement we denote a field of a record variable by designating only its field identifier (without preceding it with the entire record variable). 

The with statement below is equivalent to the preceding series of assignments: 

with P do begin with Name do begin Last := 'Whitcomb First := 'William end; Height := 186; Sex := Male; with Birth do begin , . , Year .= 1951; Mo := Sep; Day .= 12 end; 

