- Timestamp:
- Apr 3, 2010, 9:31:48 PM (15 years ago)
- Location:
- tools/dbc_export
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dbc_export/DBCExport.lpi
r380 r414 31 31 </local> 32 32 </RunParams> 33 <Units Count=" 18">33 <Units Count="20"> 34 34 <Unit0> 35 35 <Filename Value="DBCExport.pas"/> 36 36 <IsPartOfProject Value="True"/> 37 37 <UnitName Value="DBCExport"/> 38 <CursorPos X=" 49" Y="84"/>38 <CursorPos X="22" Y="78"/> 39 39 <TopLine Value="58"/> 40 40 <EditorIndex Value="0"/> 41 <UsageCount Value="8 0"/>41 <UsageCount Value="83"/> 42 42 <Loaded Value="True"/> 43 43 <SyntaxHighlighter Value="Delphi"/> … … 117 117 <CursorPos X="13" Y="308"/> 118 118 <TopLine Value="222"/> 119 <UsageCount Value="7 1"/>119 <UsageCount Value="74"/> 120 120 <SyntaxHighlighter Value="Delphi"/> 121 121 </Unit11> … … 124 124 <IsPartOfProject Value="True"/> 125 125 <UnitName Value="UDBC"/> 126 <CursorPos X="27" Y="139"/> 127 <TopLine Value="89"/> 128 <UsageCount Value="71"/> 126 <CursorPos X="13" Y="114"/> 127 <TopLine Value="121"/> 128 <EditorIndex Value="1"/> 129 <UsageCount Value="74"/> 130 <Loaded Value="True"/> 129 131 <SyntaxHighlighter Value="Delphi"/> 130 132 </Unit12> … … 134 136 <CursorPos X="51" Y="8"/> 135 137 <TopLine Value="1"/> 136 <UsageCount Value="7 1"/>138 <UsageCount Value="74"/> 137 139 <SyntaxHighlighter Value="None"/> 138 140 </Unit13> … … 162 164 <UsageCount Value="10"/> 163 165 </Unit17> 166 <Unit18> 167 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/classesh.inc"/> 168 <CursorPos X="15" Y="742"/> 169 <TopLine Value="723"/> 170 <UsageCount Value="10"/> 171 </Unit18> 172 <Unit19> 173 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/streams.inc"/> 174 <CursorPos X="8" Y="390"/> 175 <TopLine Value="387"/> 176 <UsageCount Value="10"/> 177 </Unit19> 164 178 </Units> 165 <JumpHistory Count=" 16" HistoryIndex="15">179 <JumpHistory Count="29" HistoryIndex="28"> 166 180 <Position1> 167 181 <Filename Value="DBCExport.pas"/> … … 228 242 <Caret Line="83" Column="22" TopLine="59"/> 229 243 </Position16> 244 <Position17> 245 <Filename Value="DBCExport.pas"/> 246 <Caret Line="93" Column="8" TopLine="63"/> 247 </Position17> 248 <Position18> 249 <Filename Value="DBCExport.pas"/> 250 <Caret Line="172" Column="16" TopLine="145"/> 251 </Position18> 252 <Position19> 253 <Filename Value="UDBC.pas"/> 254 <Caret Line="120" Column="30" TopLine="90"/> 255 </Position19> 256 <Position20> 257 <Filename Value="UDBC.pas"/> 258 <Caret Line="109" Column="14" TopLine="87"/> 259 </Position20> 260 <Position21> 261 <Filename Value="UDBC.pas"/> 262 <Caret Line="108" Column="19" TopLine="92"/> 263 </Position21> 264 <Position22> 265 <Filename Value="UDBC.pas"/> 266 <Caret Line="113" Column="47" TopLine="92"/> 267 </Position22> 268 <Position23> 269 <Filename Value="UDBC.pas"/> 270 <Caret Line="87" Column="1" TopLine="68"/> 271 </Position23> 272 <Position24> 273 <Filename Value="UDBC.pas"/> 274 <Caret Line="135" Column="15" TopLine="110"/> 275 </Position24> 276 <Position25> 277 <Filename Value="UDBC.pas"/> 278 <Caret Line="139" Column="15" TopLine="110"/> 279 </Position25> 280 <Position26> 281 <Filename Value="UDBC.pas"/> 282 <Caret Line="135" Column="15" TopLine="110"/> 283 </Position26> 284 <Position27> 285 <Filename Value="UDBC.pas"/> 286 <Caret Line="107" Column="18" TopLine="86"/> 287 </Position27> 288 <Position28> 289 <Filename Value="UDBC.pas"/> 290 <Caret Line="116" Column="17" TopLine="86"/> 291 </Position28> 292 <Position29> 293 <Filename Value="UDBC.pas"/> 294 <Caret Line="107" Column="18" TopLine="77"/> 295 </Position29> 230 296 </JumpHistory> 231 297 </ProjectOptions> -
tools/dbc_export/DBCExport.pas
r380 r414 138 138 Text := ''; 139 139 for X := 0 to Length(Cells[Y]) - 1 do 140 if VarIsStr(Cells[Y, X]) then Text := Text + Cells[Y, X] + ', '140 if VarIsStr(Cells[Y, X]) then Text := Text + '"' + Cells[Y, X] + '", ' 141 141 else Text := Text + IntToStr(Cells[Y, X]) + ', '; 142 142 WriteLn(Text); … … 158 158 if ColumnTypeDefinition[I] = 's' then begin 159 159 LoadColumnStrings(I - 1); 160 LastIndexStringColumns :=I;160 LastIndexStringColumns := I; 161 161 end; 162 162 end else WriteLn('File ' + DBCFileName + ' not exists.'); -
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.