^_— ————__—}
Constructor TEMSVector.Load(var F: File);
{Создает объект TEMSVector - читает из файла базовый объект TEMSArea, затем заголовок и поля ItemS, Minind, Maxind.} var
S: String;
begin
TEMSArea.Load(F); {Загружаем из файла базовый объект} if not EMSErrorFlag then
if ReadFile(F,S,SizeOf(RegHeadTEMSVector))
and (S=RegHeadTEMSVector) then begin
if ReadFile(F,Items,4) then if ReadFile(F,MinInd,4) then ReadFile(F,Maxind,4) ;
if EMSErrorFlag then
Done end else
EMSError($A6) end; {TEMSVector.Load} ^————————————;
Procedure TEMSVector.Store(var F: File);
{Сохраняет вектор в файле - сначала сохраняет базовый объект, потом заголовок и поля ItemS, Minind, Maxind.}
begin
TEMSArea.Store(F) ;
if not EMSErrorFlag then begin
if WriteFile(F,RegHeadTEMSVector, SizeOf(RegHeadTEMSVector)) then if WriteFile(F,ItemS,4) then if WriteFile(F,Minind,4) then
WriteFile(F,Maxind,4) end end; {TEMSVector.} ^__—___——.__————;
Procedure TEMSVector.Setltem(var Source; Index: LongInt);
{Помещает в EMS элемент с индексом Index из переменной Source) begin HIFNDEF NOTCHECK}
if (Index>MaxInd) or (Index<MinInd) then
EMSError($AB) {Неправильный индекс} else {$endIFf
WriteEMS(Source,(Index-MinInd)*ItemS,ItemS) end; {TEMSVector.Setltem} ^__-.__—— _——_———;
Procedure TEMSVector.GetItem(var Dest; Index: LongInt);
{Читает из EMS элемент массива с индексом Index} begin {$IFNDEF NOTCHECK} if (Index>MaxInd) or (Index<MinInd) then
EMSError($AB) (Неправильный индекс} else {$endIF}
ReadEMS((Index-MinInd)*ItemS,Dest,ItemS) end; {TEMSVector.GetItem (•—————_———— -,-}