Changeset 286 for branches/web/UCore.pas
- Timestamp:
- Sep 8, 2010, 10:08:43 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/web/UCore.pas
r279 r286 21 21 function PagesList(URL: string; Page, TotalCount, CountPerPage: Integer): string; 22 22 function StrRepeat(Data: string; Count: Integer): string; 23 function FormatOutput(Data: string): string; 24 23 25 24 type 26 25 TRegistredPage = record … … 177 176 end; 178 177 179 function FormatOutput(Data: string): string;180 var181 BlockStart, BlockEnd: Integer;182 Indention: Integer;183 Indention2: Integer;184 Line: string;185 Command: string;186 begin187 Result := '';188 Indention := 0;189 Indention2 := 0;190 while Data <> '' do begin191 //WebWrite('.');192 BlockStart := Pos('<', Data);193 BlockEnd := Pos('>', Data);194 if BlockStart > 1 then begin195 BlockEnd := BlockStart - 1;196 BlockStart := 1;197 end;198 Line := Trim(Copy(Data, BlockStart, BlockEnd));199 //WebWriteLn(Line);200 if Length(Line) > 0 then201 if Line[1] = '<' then begin202 if Data[BlockStart + 1] = '/' then begin203 Indention := Indention - 2;204 Indention2 := Indention;205 end else begin206 if Pos(' ', Line) > 0 then Command := Copy(Line, 2, Pos(' ', Line) - 2)207 else Command := Copy(Line, 2, Length(Line) - 2);208 //WebWriteLn(Command + ' ' + IntToStr(Indention));209 if Pos('</' + Command + '>', Data) > 0 then Indention := Indention + 2;210 //WebWriteLn(IntToStr(Indention) + ',' + IntToStr(Indention2));211 end;212 end;213 if Line <> '' then Result := Result + StrRepeat(' ', Indention2) + Line + #13#10;214 Data := Copy(Data, BlockEnd + 1, Length(Data));215 Indention2 := Indention;216 end;217 end;218 178 219 179 initialization
Note:
See TracChangeset
for help on using the changeset viewer.