diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-09-30 17:23:47 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-09-30 17:23:47 +0200 |
commit | 7f23c85ee8975070895462e5c9e9362b4868835f (patch) | |
tree | a74d1e99c1cc92c19acc2f01c793ba7d92e8eb98 | |
parent | 5415a8f48ef11ac70e242d7c48bf1e735699c8ac (diff) | |
download | fpGUI-7f23c85ee8975070895462e5c9e9362b4868835f.tar.xz |
work in process!
-rw-r--r-- | src/HelpFile.pas | 28 | ||||
-rw-r--r-- | src/HelpFileHeader.pas | 1 |
2 files changed, 26 insertions, 3 deletions
diff --git a/src/HelpFile.pas b/src/HelpFile.pas index 9cd6f1ce..6e016729 100644 --- a/src/HelpFile.pas +++ b/src/HelpFile.pas @@ -227,24 +227,46 @@ var Topic: TTopic; EntryIndex: longint; pEntry: pTTOCEntryStart; + tocarray: array of Int32; + p: PByte; begin _Topics.Capacity := _Header.ntoc; +//--------------------------------- experimental >> + SetLength(tocarray, _Header.ntoc); + p := _Data + _Header.tocoffsetsstart; + + Move(p, tocarray, SizeOf(tocarray)); + for EntryIndex := 0 to _Header.ntoc-1 do + begin + pEntry := _Data + tocarray[EntryIndex]; + writeln('pEntry^.length = ', IntToStr(pEntry^.Length) + ' NumSlots=' + IntToStr(pEntry^.numSlots)); + Topic := TTopic.Create( _Data, + _Header, + _Dictionary, + pEntry ); + end; + SetLength(tocarray, 0); + exit; +//---------------------------------- + pEntry:= _Data + _Header.tocstart; - for EntryIndex := 0 to integer( _Header.ntoc ) - 1 do +writeln('----------- old method '); + for EntryIndex := 0 to _Header.ntoc-1 do begin Topic:= TTopic.Create( _Data, _Header, _Dictionary, pEntry ); - Topic.HelpFile:= Self; - Topic.Index:= EntryIndex; + Topic.HelpFile := Self; + Topic.Index := EntryIndex; _Topics.Add( Topic ); inc( pEntry, pEntry^.Length ); + writeln('Topic ' + IntToStr(EntryIndex) + ' length = ' + IntToStr(pEntry^.Length)); end; end; diff --git a/src/HelpFileHeader.pas b/src/HelpFileHeader.pas index a75eef82..c971cc9e 100644 --- a/src/HelpFileHeader.pas +++ b/src/HelpFileHeader.pas @@ -65,6 +65,7 @@ Type // bit4 stuff; // ?? // int4 level; // nesting level numSlots: int8; // number of "slots" occupied by the text for this toc entry + Slots : record end; end; pTTOCEntryStart = ^TTOCEntryStart; |