Changeset 414 for tools/dbc_export/UDBC.pas
- Timestamp:
- Apr 3, 2010, 9:31:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dbc_export/UDBC.pas
r348 r414 85 85 procedure TDBC.SaveToFile(FileName: string); 86 86 var 87 Signature: Cardinal; 88 Row, Col: Integer; 89 Offset: Integer; 87 Row, Col: Cardinal; 88 Offset: Cardinal; 90 89 StringList: array of string; 91 90 begin … … 103 102 Offset := 1; 104 103 // Write cells 105 for Row := 0 to RecordCount - 1 do 104 for Row := 0 to RecordCount - 1 do begin 106 105 for Col := 0 to FieldCount - 1 do begin 107 106 if VarIsStr(Cells[Row, Col]) then begin 107 //System.Write(IntToStr(Offset) + ': "' + Cells[Row, Col] + '", '); 108 108 WriteDWord(Offset); 109 109 Offset := Offset + Length(Cells[Row, Col]) + 1; 110 110 SetLength(StringList, Length(StringList) + 1); 111 111 StringList[High(StringList)] := Cells[Row, Col]; 112 end else WriteDWord(Cells[Row, Col]); 112 end else begin 113 //System.Write(IntToStr(Cells[Row, Col]) + ', '); 114 WriteDWord(Cells[Row, Col]); 115 end; 113 116 end; 117 //WriteLn; 118 end; 114 119 115 120 // Write strings 121 Offset := 1; 116 122 WriteByte(0); 117 123 for Row := 0 to Length(StringList) - 1 do begin 124 //WriteLn('Id: ' + IntToStr(Row) + ', Offset: ' + IntToStr(Offset) + ', "' + StringList[Row] + '"'); 118 125 for Col := 1 to Length(StringList[Row]) do 119 126 WriteByte(Ord(StringList[Row][Col])); 120 WriteByte(0); 127 WriteByte(0); 128 Offset := Offset + Length(StringList[Row]) + 1; 121 129 end; 130 131 // Update string block size 132 StringBlockSize := Offset; 133 Seek(16, soFromBeginning); 134 WriteDWord(StringBlockSize); 122 135 end; 123 136 end;
Note:
See TracChangeset
for help on using the changeset viewer.