Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure Search();
- var
- i:integer;
- nov: TPZapis;
- begin
- component := 0;
- twobyte := 1;
- vess := Stream1.Size;
- for tek := 0 to vess do // начинает считывать файл до конца
- begin
- result:='';
- for i := 0 to 3 do
- begin
- Stream1.Read(poisk, twobyte);
- if (poisk = ' ') or (poisk = #$A) or (poisk = #$D) then break
- else result := result + poisk; // запоминаем 4 символа
- end;
- if result ='type' then begin // если находим "type'
- result :='';
- Stream1.Seek(treeright,SoFromCurrent);
- nado := 0;
- while poisk<>#$D do
- begin
- Stream1.Read(poisk, twobyte);
- result := result + poisk;
- inc(nado);
- end;
- if (AnsiPos(' =', result))<> 0 then begin // если находим равно
- if ((AnsiPos('= ^', result))= 0) or ((AnsiPos('=^', result))= 0)
- then begin
- nado:=nado-1;
- Stream1.Seek(-nado,SoFromCurrent);
- result := '';
- while poisk <> '=' do begin
- Stream1.Read(poisk, twobyte);
- if (poisk = ' ') or (poisk = #$A) or (poisk = #$D) then break
- else result := result + poisk; // запоминаем 4 символа
- end;
- new(nov);
- nov^.Name := result;
- while poisk <> #$D do
- Stream1.Seek(right,SoFromCurrent);
- Stream1.Seek(right,SoFromCurrent);
- while poisk <> #$D do begin
- Stream1.Read(poisk, twobyte);
- result := result + poisk;
- end;
- if (AnsiPos(':', result))<> 0 then inc(component);
- if (AnsiPos('end;', result))<> 0 then inc(tek);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement