diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-07-09 16:18:25 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-07-09 16:18:25 +0200 |
commit | ad3ba9ab98e668c71a8acf928b6de130d905e9d0 (patch) | |
tree | f9561f1a19d6cfb1da3e28685050f6aa14da383e /uidesigner/vfdfile.pas | |
parent | 0494b7671d627f8f3ee2485875d934e5640ea904 (diff) | |
download | fpGUI-ad3ba9ab98e668c71a8acf928b6de130d905e9d0.tar.xz |
UIDesigner: minor code formatting & cleanup
Diffstat (limited to 'uidesigner/vfdfile.pas')
-rw-r--r-- | uidesigner/vfdfile.pas | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/uidesigner/vfdfile.pas b/uidesigner/vfdfile.pas index d505fae8..043a7fa1 100644 --- a/uidesigner/vfdfile.pas +++ b/uidesigner/vfdfile.pas @@ -64,6 +64,9 @@ type implementation +const + cBlockPrefix = '{@VFD_'; + { TVFDFile } procedure TVFDFile.AddBlock(aposition: integer; ablockid, aformname, ablockdata: string); @@ -160,7 +163,7 @@ procedure TVFDFile.FreeBlocks; var n: integer; begin - for n := 0 to FBlocks.Count-1 do + for n := FBlocks.Count-1 downto 0 do TVFDFileBlock(FBlocks[n]).Free; FBlocks.Clear; NewFormsDecl := ''; @@ -170,30 +173,23 @@ end; function TVFDFile.GetBlocks: integer; var n: integer; - s: string; - startp, endp: integer; formname: string; bname, startmarker, endmarker: string; datablock: string; deletelen: integer; - dropmarker: boolean; begin FreeBlocks; - FParsedData := FFileData; // searching blocks: - repeat - bname := ''; formname := ''; datablock := ''; - - s := '{@VFD_'; + s := cBlockPrefix; startp := pos(s, FParsedData); if startp > 0 then begin @@ -221,7 +217,6 @@ begin // Writeln('marker: ', startmarker); // block marker ? - endmarker := ''; if bname = 'VFD_HEAD_BEGIN' then //or (bname = 'VFD_BODY_BEGIN') then endmarker := '{@VFD_HEAD_END: ' + formname + '}' @@ -285,9 +280,7 @@ var fb: TVFDFileBlock; startmarker, endmarker: string; iblock: string; - newsaved: boolean; - begin // Writeln('merging blocks: '); newsaved := False; |