Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project1;
- {$APPTYPE CONSOLE}
- {$R *.res}
- uses
- System.SysUtils;
- Type
- TPerson = Record
- Firstname: String[20];
- lastName : string[20];
- address1 : string[100];
- address2 : string[100];
- address3 : string[100];
- city : string[20];
- End;
- TPeople = Array Of TPerson;
- Var
- John, Sarah: TPerson;
- Begin
- With John Do
- Begin
- firstname := 'John';
- lastName := 'Smith';
- address1 := '7 Park Drive';
- address2 := 'Branston';
- address3 := 'Grimworth';
- city := 'Banmore';
- End;
- Sarah := John;
- Sarah.Firstname := 'Sarah';
- // Теперь показ подробностей обоих клиентов
- with John do ShowCustomer([firstName, lastName, address1, address2, address3,city ]);
- ShowMessage('');
- with Sarah do ShowCustomer([firstName, lastName, address1, address2, address3,city]);
- End;
- // Процедура, которая отображает переменное число строк
- procedure ShowCustomer(const fields: array of string);
- var
- i : Integer;
- begin
- // Отображение всех переданных полей - примечание: массивы начинаются с 0
- for i := 0 to Length(fields)-1 do
- ShowMessage(fields[i]);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement