Changeset 414 for tools


Ignore:
Timestamp:
Apr 3, 2010, 9:31:48 PM (14 years ago)
Author:
george
Message:
  • Opraveno: Ve vytvářeném DBC souboru nebyla vůbec přepočtena nová velikost bloku řetězců.
Location:
tools/dbc_export
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tools/dbc_export/DBCExport.lpi

    r380 r414  
    3131      </local>
    3232    </RunParams>
    33     <Units Count="18">
     33    <Units Count="20">
    3434      <Unit0>
    3535        <Filename Value="DBCExport.pas"/>
    3636        <IsPartOfProject Value="True"/>
    3737        <UnitName Value="DBCExport"/>
    38         <CursorPos X="49" Y="84"/>
     38        <CursorPos X="22" Y="78"/>
    3939        <TopLine Value="58"/>
    4040        <EditorIndex Value="0"/>
    41         <UsageCount Value="80"/>
     41        <UsageCount Value="83"/>
    4242        <Loaded Value="True"/>
    4343        <SyntaxHighlighter Value="Delphi"/>
     
    117117        <CursorPos X="13" Y="308"/>
    118118        <TopLine Value="222"/>
    119         <UsageCount Value="71"/>
     119        <UsageCount Value="74"/>
    120120        <SyntaxHighlighter Value="Delphi"/>
    121121      </Unit11>
     
    124124        <IsPartOfProject Value="True"/>
    125125        <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"/>
    129131        <SyntaxHighlighter Value="Delphi"/>
    130132      </Unit12>
     
    134136        <CursorPos X="51" Y="8"/>
    135137        <TopLine Value="1"/>
    136         <UsageCount Value="71"/>
     138        <UsageCount Value="74"/>
    137139        <SyntaxHighlighter Value="None"/>
    138140      </Unit13>
     
    162164        <UsageCount Value="10"/>
    163165      </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>
    164178    </Units>
    165     <JumpHistory Count="16" HistoryIndex="15">
     179    <JumpHistory Count="29" HistoryIndex="28">
    166180      <Position1>
    167181        <Filename Value="DBCExport.pas"/>
     
    228242        <Caret Line="83" Column="22" TopLine="59"/>
    229243      </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>
    230296    </JumpHistory>
    231297  </ProjectOptions>
  • tools/dbc_export/DBCExport.pas

    r380 r414  
    138138        Text := '';
    139139        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] + '", '
    141141          else Text := Text + IntToStr(Cells[Y, X]) + ', ';
    142142        WriteLn(Text);
     
    158158        if ColumnTypeDefinition[I] = 's' then begin
    159159          LoadColumnStrings(I - 1);
    160           LastIndexStringColumns:=I;
     160          LastIndexStringColumns := I;
    161161        end;
    162162    end else WriteLn('File ' + DBCFileName + ' not exists.');
  • tools/dbc_export/UDBC.pas

    r348 r414  
    8585procedure TDBC.SaveToFile(FileName: string);
    8686var
    87   Signature: Cardinal;
    88   Row, Col: Integer;
    89   Offset: Integer;
     87  Row, Col: Cardinal;
     88  Offset: Cardinal;
    9089  StringList: array of string;
    9190begin
     
    103102    Offset := 1;
    104103    // Write cells
    105     for Row := 0 to RecordCount - 1 do
     104    for Row := 0 to RecordCount - 1 do begin
    106105      for Col := 0 to FieldCount - 1 do begin
    107106        if VarIsStr(Cells[Row, Col]) then begin
     107          //System.Write(IntToStr(Offset) + ': "' + Cells[Row, Col] + '", ');
    108108          WriteDWord(Offset);
    109109          Offset := Offset + Length(Cells[Row, Col]) + 1;
    110110          SetLength(StringList, Length(StringList) + 1);
    111111          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;
    113116      end;
     117      //WriteLn;
     118    end;
    114119
    115120    // Write strings
     121    Offset := 1;
    116122    WriteByte(0);
    117123    for Row := 0 to Length(StringList) - 1 do begin
     124      //WriteLn('Id: ' + IntToStr(Row) + ', Offset: ' + IntToStr(Offset) + ', "' + StringList[Row] + '"');
    118125      for Col := 1 to Length(StringList[Row]) do
    119126        WriteByte(Ord(StringList[Row][Col]));
    120         WriteByte(0);
     127      WriteByte(0);
     128      Offset := Offset + Length(StringList[Row]) + 1;
    121129    end;
     130
     131    // Update string block size
     132    StringBlockSize := Offset;
     133    Seek(16, soFromBeginning);
     134    WriteDWord(StringBlockSize);
    122135  end;
    123136end;
Note: See TracChangeset for help on using the changeset viewer.