With/ru
Deutsch · English · Suomi · Русский
Зарезервированное слово with предназначено для сокращенного написания типа запись (структура). Оно используется совместно с ключевым словом do.
Пример:
// Объявление записи (структуры)
type
TreRecord = record
strValue: string;
intValue: integer;
dblValue: double;
end;
var
reRecord: TreRecord; // Объявляем переменную типа "запись"
begin
...
// стандартное обращение к полям записи:
reRecord.strValue := 'Test';
reRecord.intValue := 5;
reRecord.dblValue := 4.2;
// с использованием слова "with"
with reRecord do
begin
strValue := 'Test';
intValue := 5;
dblValue := 4.2;
end;
...
end;From the Free Pascal wiki, page "With/ru", as it stood on 2020-03-04 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
