Changeset 108 for Generics


Ignore:
Timestamp:
Jan 1, 2011, 10:30:09 AM (13 years ago)
Author:
george
Message:
  • Modified: TMemo in demo replaced by TListView for better result readability.
Location:
Generics/TemplateGenerics/Demo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Demo/Demo.lpi

    r107 r108  
    3838      </Item2>
    3939    </RequiredPackages>
    40     <Units Count="56">
     40    <Units Count="57">
    4141      <Unit0>
    4242        <Filename Value="Demo.lpr"/>
     
    5555        <ResourceBaseClass Value="Form"/>
    5656        <UnitName Value="UMainForm"/>
     57        <IsVisibleTab Value="True"/>
    5758        <EditorIndex Value="0"/>
    5859        <WindowIndex Value="0"/>
    59         <TopLine Value="50"/>
    60         <CursorPos X="12" Y="61"/>
     60        <TopLine Value="192"/>
     61        <CursorPos X="1" Y="213"/>
    6162        <UsageCount Value="233"/>
    6263        <Loaded Value="True"/>
     
    7071        <TopLine Value="1"/>
    7172        <CursorPos X="1" Y="11"/>
    72         <UsageCount Value="8"/>
     73        <UsageCount Value="6"/>
    7374      </Unit2>
    7475      <Unit3>
     
    7879        <TopLine Value="3"/>
    7980        <CursorPos X="43" Y="13"/>
    80         <UsageCount Value="8"/>
     81        <UsageCount Value="6"/>
    8182      </Unit3>
    8283      <Unit4>
     
    8687        <TopLine Value="33"/>
    8788        <CursorPos X="12" Y="56"/>
    88         <UsageCount Value="8"/>
     89        <UsageCount Value="6"/>
    8990      </Unit4>
    9091      <Unit5>
     
    9495        <TopLine Value="1"/>
    9596        <CursorPos X="23" Y="21"/>
    96         <UsageCount Value="8"/>
     97        <UsageCount Value="6"/>
    9798      </Unit5>
    9899      <Unit6>
     
    102103        <TopLine Value="1"/>
    103104        <CursorPos X="23" Y="24"/>
    104         <UsageCount Value="8"/>
     105        <UsageCount Value="6"/>
    105106      </Unit6>
    106107      <Unit7>
     
    110111        <TopLine Value="1"/>
    111112        <CursorPos X="23" Y="13"/>
    112         <UsageCount Value="8"/>
     113        <UsageCount Value="6"/>
    113114      </Unit7>
    114115      <Unit8>
     
    118119        <TopLine Value="1"/>
    119120        <CursorPos X="23" Y="24"/>
    120         <UsageCount Value="8"/>
     121        <UsageCount Value="6"/>
    121122      </Unit8>
    122123      <Unit9>
     
    126127        <TopLine Value="1"/>
    127128        <CursorPos X="31" Y="13"/>
    128         <UsageCount Value="8"/>
     129        <UsageCount Value="6"/>
    129130      </Unit9>
    130131      <Unit10>
     
    134135        <TopLine Value="1"/>
    135136        <CursorPos X="29" Y="17"/>
    136         <UsageCount Value="8"/>
     137        <UsageCount Value="6"/>
    137138      </Unit10>
    138139      <Unit11>
     
    141142        <TopLine Value="1"/>
    142143        <CursorPos X="1" Y="4"/>
    143         <UsageCount Value="8"/>
     144        <UsageCount Value="6"/>
    144145        <DefaultSyntaxHighlighter Value="None"/>
    145146      </Unit11>
     
    149150        <TopLine Value="1"/>
    150151        <CursorPos X="21" Y="6"/>
    151         <UsageCount Value="8"/>
     152        <UsageCount Value="6"/>
    152153        <DefaultSyntaxHighlighter Value="None"/>
    153154      </Unit12>
     
    157158        <TopLine Value="1"/>
    158159        <CursorPos X="1" Y="1"/>
    159         <UsageCount Value="8"/>
     160        <UsageCount Value="6"/>
    160161        <DefaultSyntaxHighlighter Value="None"/>
    161162      </Unit13>
     
    165166        <TopLine Value="1"/>
    166167        <CursorPos X="25" Y="13"/>
    167         <UsageCount Value="9"/>
     168        <UsageCount Value="7"/>
    168169        <DefaultSyntaxHighlighter Value="None"/>
    169170      </Unit14>
     
    173174        <TopLine Value="4"/>
    174175        <CursorPos X="3" Y="6"/>
    175         <UsageCount Value="8"/>
     176        <UsageCount Value="6"/>
    176177        <DefaultSyntaxHighlighter Value="None"/>
    177178      </Unit15>
     
    181182        <TopLine Value="1"/>
    182183        <CursorPos X="14" Y="16"/>
    183         <UsageCount Value="8"/>
     184        <UsageCount Value="6"/>
    184185        <DefaultSyntaxHighlighter Value="None"/>
    185186      </Unit16>
     
    190191        <TopLine Value="1"/>
    191192        <CursorPos X="32" Y="18"/>
    192         <UsageCount Value="8"/>
     193        <UsageCount Value="6"/>
    193194      </Unit17>
    194195      <Unit18>
     
    197198        <TopLine Value="1"/>
    198199        <CursorPos X="20" Y="12"/>
    199         <UsageCount Value="6"/>
     200        <UsageCount Value="4"/>
    200201        <DefaultSyntaxHighlighter Value="None"/>
    201202      </Unit18>
     
    206207        <TopLine Value="1"/>
    207208        <CursorPos X="1" Y="22"/>
    208         <UsageCount Value="6"/>
     209        <UsageCount Value="4"/>
    209210      </Unit19>
    210211      <Unit20>
     
    213214        <TopLine Value="1"/>
    214215        <CursorPos X="1" Y="1"/>
    215         <UsageCount Value="6"/>
     216        <UsageCount Value="4"/>
    216217        <DefaultSyntaxHighlighter Value="None"/>
    217218      </Unit20>
     
    221222        <TopLine Value="1"/>
    222223        <CursorPos X="1" Y="3"/>
    223         <UsageCount Value="6"/>
     224        <UsageCount Value="4"/>
    224225        <DefaultSyntaxHighlighter Value="None"/>
    225226      </Unit21>
     
    229230        <TopLine Value="1"/>
    230231        <CursorPos X="1" Y="3"/>
    231         <UsageCount Value="6"/>
     232        <UsageCount Value="4"/>
    232233        <DefaultSyntaxHighlighter Value="None"/>
    233234      </Unit22>
     
    238239        <TopLine Value="45"/>
    239240        <CursorPos X="9" Y="79"/>
    240         <UsageCount Value="5"/>
     241        <UsageCount Value="3"/>
    241242      </Unit23>
    242243      <Unit24>
     
    245246        <TopLine Value="1"/>
    246247        <CursorPos X="21" Y="4"/>
    247         <UsageCount Value="10"/>
     248        <UsageCount Value="8"/>
    248249        <DefaultSyntaxHighlighter Value="None"/>
    249250      </Unit24>
     
    254255        <TopLine Value="1"/>
    255256        <CursorPos X="1" Y="25"/>
    256         <UsageCount Value="10"/>
     257        <UsageCount Value="8"/>
    257258      </Unit25>
    258259      <Unit26>
     
    261262        <TopLine Value="1"/>
    262263        <CursorPos X="1" Y="3"/>
    263         <UsageCount Value="10"/>
     264        <UsageCount Value="8"/>
    264265        <DefaultSyntaxHighlighter Value="None"/>
    265266      </Unit26>
     
    269270        <TopLine Value="1"/>
    270271        <CursorPos X="7" Y="4"/>
    271         <UsageCount Value="10"/>
     272        <UsageCount Value="8"/>
    272273        <DefaultSyntaxHighlighter Value="None"/>
    273274      </Unit27>
     
    278279        <TopLine Value="1"/>
    279280        <CursorPos X="14" Y="15"/>
    280         <UsageCount Value="10"/>
     281        <UsageCount Value="8"/>
    281282      </Unit28>
    282283      <Unit29>
     
    285286        <TopLine Value="1"/>
    286287        <CursorPos X="14" Y="18"/>
    287         <UsageCount Value="10"/>
     288        <UsageCount Value="8"/>
    288289        <DefaultSyntaxHighlighter Value="None"/>
    289290      </Unit29>
     
    294295        <TopLine Value="2"/>
    295296        <CursorPos X="30" Y="8"/>
    296         <UsageCount Value="10"/>
     297        <UsageCount Value="8"/>
    297298      </Unit30>
    298299      <Unit31>
     
    302303        <TopLine Value="13"/>
    303304        <CursorPos X="15" Y="12"/>
    304         <UsageCount Value="12"/>
     305        <UsageCount Value="10"/>
    305306        <DefaultSyntaxHighlighter Value="Delphi"/>
    306307      </Unit31>
    307308      <Unit32>
    308309        <Filename Value="../Generic/GenericList.inc"/>
    309         <IsVisibleTab Value="True"/>
    310         <EditorIndex Value="5"/>
    311         <WindowIndex Value="0"/>
    312         <TopLine Value="443"/>
    313         <CursorPos X="17" Y="453"/>
    314         <UsageCount Value="99"/>
     310        <EditorIndex Value="6"/>
     311        <WindowIndex Value="0"/>
     312        <TopLine Value="3"/>
     313        <CursorPos X="1" Y="13"/>
     314        <UsageCount Value="107"/>
    315315        <Loaded Value="True"/>
    316316      </Unit32>
     
    320320        <TopLine Value="31"/>
    321321        <CursorPos X="44" Y="47"/>
    322         <UsageCount Value="98"/>
     322        <UsageCount Value="96"/>
    323323      </Unit33>
    324324      <Unit34>
     
    327327        <TopLine Value="1"/>
    328328        <CursorPos X="36" Y="48"/>
    329         <UsageCount Value="98"/>
     329        <UsageCount Value="96"/>
    330330      </Unit34>
    331331      <Unit35>
     
    334334        <TopLine Value="3"/>
    335335        <CursorPos X="1" Y="3"/>
    336         <UsageCount Value="98"/>
     336        <UsageCount Value="96"/>
    337337      </Unit35>
    338338      <Unit36>
     
    341341        <TopLine Value="11"/>
    342342        <CursorPos X="42" Y="11"/>
    343         <UsageCount Value="98"/>
     343        <UsageCount Value="96"/>
    344344      </Unit36>
    345345      <Unit37>
     
    348348        <TopLine Value="3"/>
    349349        <CursorPos X="1" Y="3"/>
    350         <UsageCount Value="98"/>
     350        <UsageCount Value="96"/>
    351351      </Unit37>
    352352      <Unit38>
     
    355355        <TopLine Value="1"/>
    356356        <CursorPos X="22" Y="30"/>
    357         <UsageCount Value="98"/>
     357        <UsageCount Value="96"/>
    358358      </Unit38>
    359359      <Unit39>
     
    363363        <TopLine Value="6"/>
    364364        <CursorPos X="56" Y="36"/>
    365         <UsageCount Value="97"/>
     365        <UsageCount Value="95"/>
    366366      </Unit39>
    367367      <Unit40>
     
    371371        <TopLine Value="27"/>
    372372        <CursorPos X="50" Y="59"/>
    373         <UsageCount Value="96"/>
     373        <UsageCount Value="94"/>
    374374      </Unit40>
    375375      <Unit41>
     
    379379        <TopLine Value="57"/>
    380380        <CursorPos X="48" Y="85"/>
    381         <UsageCount Value="96"/>
     381        <UsageCount Value="94"/>
    382382      </Unit41>
    383383      <Unit42>
     
    386386        <TopLine Value="1"/>
    387387        <CursorPos X="33" Y="14"/>
    388         <UsageCount Value="96"/>
     388        <UsageCount Value="94"/>
    389389      </Unit42>
    390390      <Unit43>
     
    394394        <TopLine Value="52"/>
    395395        <CursorPos X="1" Y="81"/>
    396         <UsageCount Value="96"/>
     396        <UsageCount Value="94"/>
    397397      </Unit43>
    398398      <Unit44>
     
    402402        <TopLine Value="29"/>
    403403        <CursorPos X="1" Y="62"/>
    404         <UsageCount Value="96"/>
     404        <UsageCount Value="94"/>
    405405      </Unit44>
    406406      <Unit45>
     
    410410        <TopLine Value="9"/>
    411411        <CursorPos X="60" Y="36"/>
    412         <UsageCount Value="95"/>
     412        <UsageCount Value="93"/>
    413413      </Unit45>
    414414      <Unit46>
    415415        <Filename Value="../Specialized/SpecializedList.pas"/>
    416416        <UnitName Value="SpecializedList"/>
    417         <EditorIndex Value="6"/>
    418         <WindowIndex Value="0"/>
    419         <TopLine Value="73"/>
     417        <EditorIndex Value="7"/>
     418        <WindowIndex Value="0"/>
     419        <TopLine Value="1"/>
    420420        <CursorPos X="1" Y="104"/>
    421         <UsageCount Value="95"/>
     421        <UsageCount Value="103"/>
    422422        <Loaded Value="True"/>
    423423      </Unit46>
    424424      <Unit47>
    425425        <Filename Value="../Generic/GenericMatrix.inc"/>
    426         <EditorIndex Value="8"/>
     426        <EditorIndex Value="9"/>
    427427        <WindowIndex Value="0"/>
    428428        <TopLine Value="1"/>
    429429        <CursorPos X="33" Y="10"/>
    430         <UsageCount Value="95"/>
     430        <UsageCount Value="103"/>
    431431        <Loaded Value="True"/>
    432432      </Unit47>
     
    437437        <TopLine Value="2624"/>
    438438        <CursorPos X="37" Y="2636"/>
    439         <UsageCount Value="94"/>
     439        <UsageCount Value="92"/>
    440440      </Unit48>
    441441      <Unit49>
     
    444444        <TopLine Value="94"/>
    445445        <CursorPos X="1" Y="1"/>
    446         <UsageCount Value="10"/>
     446        <UsageCount Value="8"/>
    447447        <DefaultSyntaxHighlighter Value="XML"/>
    448448      </Unit49>
    449449      <Unit50>
    450450        <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/classesh.inc"/>
    451         <EditorIndex Value="1"/>
    452         <WindowIndex Value="0"/>
    453         <TopLine Value="182"/>
    454         <CursorPos X="55" Y="185"/>
    455         <UsageCount Value="11"/>
     451        <EditorIndex Value="2"/>
     452        <WindowIndex Value="0"/>
     453        <TopLine Value="32"/>
     454        <CursorPos X="11" Y="36"/>
     455        <UsageCount Value="20"/>
    456456        <Loaded Value="True"/>
    457457      </Unit50>
    458458      <Unit51>
    459459        <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/lists.inc"/>
    460         <EditorIndex Value="4"/>
     460        <EditorIndex Value="5"/>
    461461        <WindowIndex Value="0"/>
    462462        <TopLine Value="462"/>
    463         <CursorPos X="3" Y="464"/>
    464         <UsageCount Value="11"/>
     463        <CursorPos X="25" Y="464"/>
     464        <UsageCount Value="20"/>
    465465        <Loaded Value="True"/>
    466466      </Unit51>
    467467      <Unit52>
    468468        <Filename Value="../Generic/GenericListObject.inc"/>
    469         <EditorIndex Value="7"/>
     469        <EditorIndex Value="8"/>
    470470        <WindowIndex Value="0"/>
    471471        <TopLine Value="1"/>
    472472        <CursorPos X="21" Y="20"/>
    473         <UsageCount Value="11"/>
     473        <UsageCount Value="20"/>
    474474        <Loaded Value="True"/>
    475475      </Unit52>
     
    477477        <Filename Value="/usr/share/fpcsrc/rtl/objpas/objpas.pp"/>
    478478        <UnitName Value="objpas"/>
    479         <EditorIndex Value="2"/>
    480         <WindowIndex Value="0"/>
    481         <TopLine Value="9"/>
     479        <EditorIndex Value="3"/>
     480        <WindowIndex Value="0"/>
     481        <TopLine Value="1"/>
    482482        <CursorPos X="27" Y="26"/>
    483         <UsageCount Value="11"/>
     483        <UsageCount Value="20"/>
    484484        <Loaded Value="True"/>
    485485      </Unit53>
    486486      <Unit54>
    487487        <Filename Value="/usr/share/fpcsrc/rtl/inc/systemh.inc"/>
    488         <EditorIndex Value="3"/>
     488        <EditorIndex Value="4"/>
    489489        <WindowIndex Value="0"/>
    490490        <TopLine Value="381"/>
    491491        <CursorPos X="3" Y="398"/>
    492         <UsageCount Value="11"/>
     492        <UsageCount Value="20"/>
    493493        <Loaded Value="True"/>
    494494      </Unit54>
     
    498498        <TopLine Value="475"/>
    499499        <CursorPos X="10" Y="503"/>
    500         <UsageCount Value="10"/>
     500        <UsageCount Value="8"/>
    501501      </Unit55>
     502      <Unit56>
     503        <Filename Value="../../../../../lazarus/trunk/lcl/include/control.inc"/>
     504        <EditorIndex Value="1"/>
     505        <WindowIndex Value="0"/>
     506        <TopLine Value="2270"/>
     507        <CursorPos X="22" Y="2273"/>
     508        <UsageCount Value="11"/>
     509        <Loaded Value="True"/>
     510      </Unit56>
    502511    </Units>
    503512    <JumpHistory Count="30" HistoryIndex="29">
    504513      <Position1>
    505         <Filename Value="../Generic/GenericList.inc"/>
    506         <Caret Line="9" Column="45" TopLine="1"/>
     514        <Filename Value="UMainForm.pas"/>
     515        <Caret Line="512" Column="30" TopLine="479"/>
    507516      </Position1>
    508517      <Position2>
    509518        <Filename Value="UMainForm.pas"/>
    510         <Caret Line="38" Column="16" TopLine="11"/>
     519        <Caret Line="506" Column="49" TopLine="482"/>
    511520      </Position2>
    512521      <Position3>
    513522        <Filename Value="UMainForm.pas"/>
    514         <Caret Line="40" Column="95" TopLine="11"/>
     523        <Caret Line="41" Column="43" TopLine="40"/>
    515524      </Position3>
    516525      <Position4>
    517526        <Filename Value="UMainForm.pas"/>
    518         <Caret Line="43" Column="37" TopLine="24"/>
     527        <Caret Line="63" Column="9" TopLine="46"/>
    519528      </Position4>
    520529      <Position5>
    521530        <Filename Value="UMainForm.pas"/>
    522         <Caret Line="37" Column="1" TopLine="29"/>
     531        <Caret Line="41" Column="55" TopLine="24"/>
    523532      </Position5>
    524533      <Position6>
    525534        <Filename Value="UMainForm.pas"/>
    526         <Caret Line="470" Column="1" TopLine="442"/>
     535        <Caret Line="506" Column="61" TopLine="483"/>
    527536      </Position6>
    528537      <Position7>
    529538        <Filename Value="UMainForm.pas"/>
    530         <Caret Line="10" Column="12" TopLine="21"/>
     539        <Caret Line="63" Column="8" TopLine="46"/>
    531540      </Position7>
    532541      <Position8>
    533542        <Filename Value="UMainForm.pas"/>
    534         <Caret Line="277" Column="17" TopLine="258"/>
     543        <Caret Line="41" Column="15" TopLine="1"/>
    535544      </Position8>
    536545      <Position9>
    537         <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/lists.inc"/>
    538         <Caret Line="596" Column="16" TopLine="590"/>
     546        <Filename Value="UMainForm.pas"/>
     547        <Caret Line="66" Column="9" TopLine="49"/>
    539548      </Position9>
    540549      <Position10>
    541         <Filename Value="../Generic/GenericList.inc"/>
    542         <Caret Line="11" Column="16" TopLine="1"/>
     550        <Filename Value="UMainForm.pas"/>
     551        <Caret Line="41" Column="15" TopLine="1"/>
    543552      </Position10>
    544553      <Position11>
    545         <Filename Value="../Generic/GenericList.inc"/>
    546         <Caret Line="46" Column="19" TopLine="18"/>
     554        <Filename Value="UMainForm.pas"/>
     555        <Caret Line="63" Column="31" TopLine="46"/>
    547556      </Position11>
    548557      <Position12>
    549         <Filename Value="../Generic/GenericList.inc"/>
    550         <Caret Line="47" Column="19" TopLine="19"/>
     558        <Filename Value="UMainForm.pas"/>
     559        <Caret Line="3" Column="19" TopLine="1"/>
    551560      </Position12>
    552561      <Position13>
    553         <Filename Value="../Generic/GenericList.inc"/>
    554         <Caret Line="48" Column="20" TopLine="20"/>
     562        <Filename Value="UMainForm.pas"/>
     563        <Caret Line="63" Column="9" TopLine="46"/>
    555564      </Position13>
    556565      <Position14>
    557         <Filename Value="../Generic/GenericList.inc"/>
    558         <Caret Line="52" Column="57" TopLine="26"/>
     566        <Filename Value="UMainForm.pas"/>
     567        <Caret Line="41" Column="26" TopLine="24"/>
    559568      </Position14>
    560569      <Position15>
    561         <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/lists.inc"/>
    562         <Caret Line="594" Column="11" TopLine="590"/>
     570        <Filename Value="UMainForm.pas"/>
     571        <Caret Line="63" Column="10" TopLine="46"/>
    563572      </Position15>
    564573      <Position16>
    565         <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/lists.inc"/>
    566         <Caret Line="596" Column="13" TopLine="590"/>
     574        <Filename Value="UMainForm.pas"/>
     575        <Caret Line="41" Column="47" TopLine="24"/>
    567576      </Position16>
    568577      <Position17>
    569         <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/lists.inc"/>
    570         <Caret Line="98" Column="56" TopLine="89"/>
     578        <Filename Value="UMainForm.pas"/>
     579        <Caret Line="506" Column="53" TopLine="483"/>
    571580      </Position17>
    572581      <Position18>
    573         <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/lists.inc"/>
    574         <Caret Line="91" Column="43" TopLine="89"/>
     582        <Filename Value="UMainForm.pas"/>
     583        <Caret Line="63" Column="43" TopLine="46"/>
    575584      </Position18>
    576585      <Position19>
    577         <Filename Value="../Generic/GenericList.inc"/>
    578         <Caret Line="470" Column="59" TopLine="206"/>
     586        <Filename Value="UMainForm.pas"/>
     587        <Caret Line="61" Column="17" TopLine="46"/>
    579588      </Position19>
    580589      <Position20>
    581590        <Filename Value="UMainForm.pas"/>
    582         <Caret Line="277" Column="17" TopLine="258"/>
     591        <Caret Line="64" Column="17" TopLine="47"/>
    583592      </Position20>
    584593      <Position21>
    585         <Filename Value="../Generic/GenericList.inc"/>
    586         <Caret Line="161" Column="1" TopLine="161"/>
     594        <Filename Value="UMainForm.pas"/>
     595        <Caret Line="50" Column="49" TopLine="31"/>
    587596      </Position21>
    588597      <Position22>
    589         <Filename Value="../Generic/GenericList.inc"/>
    590         <Caret Line="89" Column="14" TopLine="84"/>
     598        <Filename Value="UMainForm.pas"/>
     599        <Caret Line="61" Column="17" TopLine="47"/>
    591600      </Position22>
    592601      <Position23>
    593         <Filename Value="../Generic/GenericList.inc"/>
    594         <Caret Line="189" Column="29" TopLine="172"/>
     602        <Filename Value="UMainForm.pas"/>
     603        <Caret Line="64" Column="11" TopLine="47"/>
    595604      </Position23>
    596605      <Position24>
    597         <Filename Value="../Generic/GenericList.inc"/>
    598         <Caret Line="405" Column="14" TopLine="389"/>
     606        <Filename Value="UMainForm.pas"/>
     607        <Caret Line="63" Column="34" TopLine="41"/>
    599608      </Position24>
    600609      <Position25>
    601         <Filename Value="../Generic/GenericList.inc"/>
    602         <Caret Line="51" Column="59" TopLine="34"/>
     610        <Filename Value="UMainForm.pas"/>
     611        <Caret Line="432" Column="14" TopLine="415"/>
    603612      </Position25>
    604613      <Position26>
    605         <Filename Value="../Generic/GenericList.inc"/>
    606         <Caret Line="119" Column="3" TopLine="117"/>
     614        <Filename Value="UMainForm.pas"/>
     615        <Caret Line="41" Column="34" TopLine="24"/>
    607616      </Position26>
    608617      <Position27>
    609         <Filename Value="../Generic/GenericList.inc"/>
    610         <Caret Line="433" Column="19" TopLine="416"/>
     618        <Filename Value="UMainForm.pas"/>
     619        <Caret Line="506" Column="40" TopLine="483"/>
    611620      </Position27>
    612621      <Position28>
    613622        <Filename Value="UMainForm.pas"/>
    614         <Caret Line="278" Column="17" TopLine="91"/>
     623        <Caret Line="41" Column="46" TopLine="24"/>
    615624      </Position28>
    616625      <Position29>
    617         <Filename Value="../Specialized/SpecializedList.pas"/>
    618         <Caret Line="104" Column="5" TopLine="73"/>
     626        <Filename Value="UMainForm.pas"/>
     627        <Caret Line="506" Column="47" TopLine="483"/>
    619628      </Position29>
    620629      <Position30>
    621630        <Filename Value="UMainForm.pas"/>
    622         <Caret Line="403" Column="11" TopLine="385"/>
     631        <Caret Line="142" Column="38" TopLine="114"/>
    623632      </Position30>
    624633    </JumpHistory>
  • Generics/TemplateGenerics/Demo/UMainForm.lfm

    r91 r108  
    11object MainForm: TMainForm
    2   Left = 388
    3   Height = 397
    4   Top = 121
    5   Width = 478
     2  Left = 261
     3  Height = 520
     4  Top = 104
     5  Width = 692
    66  ActiveControl = ButtonIntegerList
    77  Caption = 'Template generics demo'
    8   ClientHeight = 397
    9   ClientWidth = 478
     8  ClientHeight = 520
     9  ClientWidth = 692
    1010  OnCreate = FormCreate
    1111  OnDestroy = FormDestroy
     
    2020    TabOrder = 0
    2121  end
    22   object MemoOutput: TMemo
    23     Left = 144
    24     Height = 384
    25     Top = 8
    26     Width = 328
    27     Anchors = [akTop, akLeft, akRight, akBottom]
    28     ReadOnly = True
    29     ScrollBars = ssAutoBoth
    30     TabOrder = 1
    31   end
    3222  object ButtonStringList: TButton
    3323    Left = 8
     
    3727    Caption = 'TListString'
    3828    OnClick = ButtonStringListClick
    39     TabOrder = 2
     29    TabOrder = 1
    4030  end
    4131  object ButtonDictionaryString: TButton
     
    4636    Caption = 'TDictionaryString'
    4737    OnClick = ButtonDictionaryStringClick
    48     TabOrder = 3
     38    TabOrder = 2
    4939  end
    5040  object ButtonQueueInteger: TButton
     
    5545    Caption = 'TQueueInteger'
    5646    OnClick = ButtonQueueIntegerClick
    57     TabOrder = 4
     47    TabOrder = 3
    5848  end
    5949  object ButtonCharList: TButton
     
    6454    Caption = 'TListChar(TString)'
    6555    OnClick = ButtonCharListClick
    66     TabOrder = 5
     56    TabOrder = 4
    6757  end
    6858  object ButtonBenchmarkList: TButton
    6959    Left = 8
    70     Height = 25
    71     Top = 367
     60    Height = 24
     61    Top = 491
    7262    Width = 128
     63    Anchors = [akLeft, akBottom]
    7364    Caption = 'Benchmark list'
    7465    OnClick = ButtonBenchmarkListClick
    75     TabOrder = 6
     66    TabOrder = 5
    7667  end
    7768  object ButtonListObject: TButton
     
    8273    Caption = 'TListObject'
    8374    OnClick = ButtonListObjectClick
    84     TabOrder = 7
     75    TabOrder = 6
    8576  end
    8677  object ButtonBenchmarkDictionary: TButton
    8778    Left = 10
    8879    Height = 25
    89     Top = 336
     80    Top = 459
    9081    Width = 126
     82    Anchors = [akLeft, akBottom]
    9183    Caption = 'Benchmark dictionary'
    9284    OnClick = ButtonBenchmarkDictionaryClick
     85    TabOrder = 7
     86  end
     87  object ButtonMatrixInteger: TButton
     88    Left = 7
     89    Height = 25
     90    Top = 192
     91    Width = 129
     92    Caption = 'TMatrixInteger'
     93    OnClick = ButtonMatrixIntegerClick
    9394    TabOrder = 8
    9495  end
     96  object ListViewOutput: TListView
     97    Left = 144
     98    Height = 507
     99    Top = 8
     100    Width = 542
     101    Anchors = [akTop, akLeft, akRight, akBottom]
     102    Columns = <   
     103      item
     104        Caption = 'Action'
     105        Width = 200
     106      end   
     107      item
     108        Caption = 'Value'
     109        Width = 316
     110      end>
     111    ReadOnly = True
     112    TabOrder = 9
     113    ViewStyle = vsReport
     114  end
    95115end
  • Generics/TemplateGenerics/Demo/UMainForm.pas

    r107 r108  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    99  ComCtrls, SpecializedList, SpecializedDictionary, SpecializedQueue,
    10   DateUtils;
     10  DateUtils, SpecializedMatrix;
    1111
    1212type
     
    1919    ButtonBenchmarkList: TButton;
    2020    ButtonCharList: TButton;
     21    ButtonMatrixInteger: TButton;
    2122    ButtonQueueInteger: TButton;
    2223    ButtonDictionaryString: TButton;
    2324    ButtonIntegerList: TButton;
    2425    ButtonStringList: TButton;
    25     MemoOutput: TMemo;
     26    ListViewOutput: TListView;
    2627    procedure ButtonBenchmarkDictionaryClick(Sender: TObject);
    2728    procedure ButtonBenchmarkListClick(Sender: TObject);
     
    2930    procedure ButtonDictionaryStringClick(Sender: TObject);
    3031    procedure ButtonIntegerListClick(Sender: TObject);
     32    procedure ButtonMatrixIntegerClick(Sender: TObject);
    3133    procedure ButtonListObjectClick(Sender: TObject);
    3234    procedure ButtonQueueIntegerClick(Sender: TObject);
     
    3739  public
    3840    Bitmap: TBitmap;
    39     procedure WriteLn(Text: string = '');
     41    procedure WriteOutput(Text1: string = ''; Text2: string = '');
    4042  end;
    4143
     
    5860  I: Integer;
    5961begin
    60   MemoOutput.Clear;
    61   WriteLn('TListInteger test');
     62  ListViewOutput.Clear;
     63  WriteOutput('TListInteger test');
    6264  List := TListInteger.Create;
    6365  with List do try
    64     WriteLn('AddArray([10, 20, 30, 40])');
    6566    AddArray([10, 20, 30, 40]);
    66     WriteLn('Implode: ' + Implode(',', IntToStr));
     67    WriteOutput('AddArray([10, 20, 30, 40])', Implode(',', IntToStr));
     68    Clear;
     69    WriteOutput('Clear', Implode(',', IntToStr));
     70    for I := 0 to 10 do Add(I);
     71    WriteOutput('for I := 0 to 10 do Add(I)', Implode(',', IntToStr));
     72    WriteOutput('Count', IntToStr(Count));
     73    Reverse;
     74    WriteOutput('Reverse', Implode(',', IntToStr));
     75    WriteOutput('First', IntToStr(First));
     76    WriteOutput('Last', IntToStr(Last));
     77    MoveItems(3, 2, 3);
     78    WriteOutput('MoveItems(3, 2, 3)', Implode(',', IntToStr));
     79    Insert(5, 11);
     80    WriteOutput('Insert(5, 11)', Implode(',', IntToStr));
     81  finally
     82    Free;
     83  end;
     84end;
     85
     86procedure TMainForm.ButtonMatrixIntegerClick(Sender: TObject);
     87var
     88  Matrix: TMatrixInteger;
     89  I: Integer;
     90begin
     91  ListViewOutput.Clear;
     92  WriteOutput('TListInteger test');
     93  Matrix := TMatrixInteger.Create;
     94  with Matrix do try
     95    WriteOutput('AddMatrix([10, 20, 30, 40])');
     96    //AddMatrix([10, 20, 30, 40]);
     97    WriteOutput('Implode: ' + Implode(',', IntToStr));
    6798    Clear;
    6899    for I := 0 to 10 do Add(I);
    69     WriteLn('Implode: ' + Implode(',', IntToStr));
    70     WriteLn('Count: ' + IntToStr(Count));
    71     WriteLn('Implode: ' + Implode(',', IntToStr));
    72     WriteLn('Reverse');
     100    WriteOutput('Implode: ' + Implode(',', IntToStr));
     101    WriteOutput('Count: Y: ' + IntToStr(Count.Y) + ', ' + IntToStr(Count.X));
     102    WriteOutput('Implode: ' + Implode(',', IntToStr));
     103    WriteOutput('Reverse');
    73104    Reverse;
    74     WriteLn('Implode: ' + Implode(',', IntToStr));
    75     WriteLn('First: ' + IntToStr(First));
    76     WriteLn('Last: ' + IntToStr(Last));
    77     MoveItems(3, 2, 3);
    78     WriteLn('Implode: ' + Implode(',', IntToStr));
    79     WriteLn('Insert(5, 11)');
    80     Insert(5, 11);
    81     WriteLn('Implode: ' + Implode(',', IntToStr));
     105    WriteOutput('Implode: ' + Implode(',', IntToStr));
     106    WriteOutput('First: ' + IntToStr(First));
     107    WriteOutput('Last: ' + IntToStr(Last));
     108    //MoveItems(3, 2, 3);
     109    WriteOutput('Implode: ' + Implode(',', IntToStr));
     110    WriteOutput('Insert(5, 11)');
     111    //Insert(5, 11);
     112    WriteOutput('Implode: ' + Implode(',', IntToStr));
    82113  finally
    83114    Free;
     
    95126  I: Integer;
    96127begin
    97   MemoOutput.Clear;
    98   WriteLn('TListObject test');
     128  ListViewOutput.Clear;
     129  WriteOutput('TListObject test');
    99130  List := TListObject.Create;
    100131  with List do try
    101132    AddArray([TObject.Create, TObject.Create, TObject.Create, TObject.Create]);
    102     WriteLn('Implode: ' + Implode(',', ObjectToStr));
     133    WriteOutput('AddArray([TObject.Create, TObject.Create, TObject.Create, TObject.Create])', Implode(',', ObjectToStr));
    103134    Clear;
     135    WriteOutput('Clear', Implode(',', ObjectToStr));
    104136    for I := 0 to 10 do Add(TObject.Create);
    105     WriteLn('Implode: ' + Implode(',', ObjectToStr));
    106     WriteLn('Count: ' + IntToStr(Count));
    107     WriteLn('Implode: ' + Implode(',', ObjectToStr));
    108     WriteLn('Reverse');
     137    WriteOutput('for I := 0 to 10 do Add(TObject.Create)', Implode(',', ObjectToStr));
     138    WriteOutput('Count', IntToStr(Count));
    109139    Reverse;
    110     WriteLn('Implode: ' + Implode(',', ObjectToStr));
     140    WriteOutput('Reverse', Implode(',', ObjectToStr));
    111141    MoveItems(3, 2, 3);
    112     WriteLn('Implode: ' + Implode(',', ObjectToStr));
     142    WriteOutput('MoveItems(3, 2, 3)', Implode(',', ObjectToStr));
    113143  finally
    114144    Free;
     
    121151  I: Integer;
    122152begin
    123   MemoOutput.Clear;
    124   WriteLn('TQueueInteger test');
     153  ListViewOutput.Clear;
     154  WriteOutput('TQueueInteger test');
    125155  Queue := TQueueInteger.Create;
    126156  with Queue do try
     
    128158    Enqueue(2);
    129159    Enqueue(3);
    130     WriteLn('Implode: ' + List.Implode(',', IntToStr));
    131     WriteLn('Enqueue: 4');
     160    WriteOutput('Enqueue(1),Enqueue(2),Enqueue(3) ', List.Implode(',', IntToStr));
    132161    Enqueue(4);
    133     WriteLn('Implode: ' + List.Implode(',', IntToStr));
    134     WriteLn('Dequeue: ' + IntToStr(Dequeue));
    135     WriteLn('Implode: ' + List.Implode(',', IntToStr));
     162    WriteOutput('Enqueue(4)', List.Implode(',', IntToStr));
     163    WriteOutput('Dequeued item', IntToStr(Dequeue));
     164    WriteOutput('Dequeue', List.Implode(',', IntToStr));
    136165  finally
    137166    Free;
     
    148177  Dictionary: TDictionaryStringString;
    149178begin
    150   MemoOutput.Clear;
    151   WriteLn('TDictionaryString test');
     179  ListViewOutput.Clear;
     180  WriteOutput('TDictionaryString test');
    152181  Dictionary := TDictionaryStringString.Create;
    153182  with Dictionary do try
     
    155184    Add('Key2', 'Value2');
    156185    Add('Key3', 'Value3');
    157     WriteLn('Implode: ' + Implode(',', StringPairToStr));
    158     WriteLn('Values[Key2]: ' + Values['Key2']);
    159     WriteLn('Values[Key2] = None');
     186    WriteOutput('Add(''Key1'', ''Value1''),Add(''Key1'', ''Value1''),Add(''Key1'', ''Value1'')', Implode(',', StringPairToStr));
     187    WriteOutput('Values[Key2]', Values['Key2']);
     188    WriteOutput('Values[Key2] = None');
    160189    Values['Key2'] := 'None';
    161     WriteLn('Values[Key2]: ' + Values['Key2']);
    162     WriteLn('Values[Key0]: ' + Values['Key0']);
    163     WriteLn('Keys[2]: ' + Keys[2]);
     190    WriteOutput('Values[Key2]', Values['Key2']);
     191    WriteOutput('Values[Key0]', Values['Key0']);
     192    WriteOutput('Keys[2]', Keys[2]);
    164193  finally
    165194    Free;
     
    176205  List: TListChar;
    177206begin
    178   MemoOutput.Clear;
    179   WriteLn('TListChar test');
     207  ListViewOutput.Clear;
     208  WriteOutput('TListChar test');
    180209  List := TListChar.Create;
    181210  with List do try
    182211    AddArray([' ', ' ', 'A', 'b', 'c', 'd', ' ']);
    183     WriteLn('Implode: ''' + Implode('', CharToStr) + '''');
    184     WriteLn('Implode: ' + Implode('', CharToStr));
    185     WriteLn('Reverse');
     212    WriteOutput('AddArray(['' '', '' '', ''A'', ''b'', ''c'', ''d'', '' ''])',
     213      '''' + Implode('', CharToStr) + '''');
    186214    Reverse;
    187     WriteLn('Implode: ''' + Implode('', CharToStr) + '''');
    188     WriteLn('TrimLeft');
     215    WriteOutput('Reverse', '''' + Implode('', CharToStr) + '''');
    189216    TrimLeft;
    190     WriteLn('Implode: ''' + Implode('', CharToStr) + '''');
    191     WriteLn('TrimRight');
     217    WriteOutput('TrimLeft', '''' + Implode('', CharToStr) + '''');
    192218    TrimRight;
    193     WriteLn('Implode: ''' + Implode('', CharToStr) + '''');
    194     WriteLn('UpperCase');
     219    WriteOutput('TrimRight', '''' + Implode('', CharToStr) + '''');
    195220    UpperCase;
    196     WriteLn('Implode: ''' + Implode('', CharToStr) + '''');
     221    WriteOutput('UpperCase', '''' + Implode('', CharToStr) + '''');
     222    LowerCase;
     223    WriteOutput('LowerCase', '''' + Implode('', CharToStr) + '''');
    197224  finally
    198225    Free;
     
    207234  I: Integer;
    208235begin
    209   MemoOutput.Clear;
     236  ListViewOutput.Clear;
    210237  try
    211238    List := TListPointer.Create;
    212     WriteLn('TListPointer...');
     239    List2 := TList.Create;
     240
    213241    StartTime := Now;
    214242    repeat
    215243      List.Add(1);
    216244    until (Now - StartTime) > OneSecond;
    217     WriteLn('Add: ' + IntToStr(List.Count) + ' ops/sec');
     245    WriteOutput('TListPointer.Add', IntToStr(List.Count) + ' ops/sec');
    218246    List.Clear;
    219247    Application.ProcessMessages;
     
    221249    StartTime := Now;
    222250    repeat
     251      List2.Add(1);
     252    until (Now - StartTime) > OneSecond;
     253    WriteOutput('TList.Add', IntToStr(List2.Count) + ' ops/sec');
     254    List2.Clear;
     255    Application.ProcessMessages;
     256
     257    StartTime := Now;
     258    repeat
    223259      List.Insert(0, 1);
    224260    until (Now - StartTime) > OneSecond;
    225     WriteLn('Insert: ' + IntToStr(List.Count) + ' ops/sec');
     261    WriteOutput('TListPointer.Insert', IntToStr(List.Count) + ' ops/sec');
    226262    List.Clear;
    227263    Application.ProcessMessages;
    228264
     265    StartTime := Now;
     266    repeat
     267      List2.Insert(0, 1);
     268    until (Now - StartTime) > OneSecond;
     269    WriteOutput('TList.Insert', IntToStr(List2.Count) + ' ops/sec');
     270    List2.Clear;
     271    Application.ProcessMessages;
     272
    229273    for I := 0 to 1000000 do
    230274      List.Add(1);
     
    235279      Inc(I);
    236280    until (Now - StartTime) > OneSecond;
    237     WriteLn('Delete: ' + IntToStr(I) + ' ops/sec');
     281    WriteOutput('TListPointer.Delete', IntToStr(I) + ' ops/sec');
    238282    List.Clear;
    239283    Application.ProcessMessages;
    240284
    241285    for I := 0 to 1000000 do
     286      List2.Add(1);
     287    StartTime := Now;
     288    I := 0;
     289    repeat
     290      List2.Delete(0);
     291      Inc(I);
     292    until (Now - StartTime) > OneSecond;
     293    WriteOutput('TList.Delete', IntToStr(I) + ' ops/sec');
     294    Application.ProcessMessages;
     295
     296    for I := 0 to 1000000 do
    242297      List.Add(1);
    243298    StartTime := Now;
     
    247302      Inc(I);
    248303    until (Now - StartTime) > OneSecond;
    249     WriteLn('Move: ' + IntToStr(I) + ' ops/sec');
     304    WriteOutput('TListPointer.Move', IntToStr(I) + ' ops/sec');
    250305    List.Clear;
    251306    Application.ProcessMessages;
    252307
    253308    for I := 0 to 1000000 do
     309    List2.Add(1);
     310    StartTime := Now;
     311    I := 0;
     312    repeat
     313      List2.Move(300000, 700000);
     314      Inc(I);
     315    until (Now - StartTime) > OneSecond;
     316    WriteOutput('TList.Move', IntToStr(I) + ' ops/sec');
     317    Application.ProcessMessages;
     318
     319    for I := 0 to 1000000 do
    254320      List.Add(1);
    255321    StartTime := Now;
     
    259325      Inc(I);
    260326    until (Now - StartTime) > OneSecond;
    261     WriteLn('Exchange: ' + IntToStr(I) + ' ops/sec');
     327    WriteOutput('TListPointer.Exchange', IntToStr(I) + ' ops/sec');
    262328    List.Clear;
    263329    Application.ProcessMessages;
    264330
    265331    for I := 0 to 1000000 do
     332    List2.Add(1);
     333    StartTime := Now;
     334    I := 0;
     335    repeat
     336      List2.Exchange(300000, 700000);
     337      Inc(I);
     338    until (Now - StartTime) > OneSecond;
     339    WriteOutput('TList.Exchange', IntToStr(I) + ' ops/sec');
     340    Application.ProcessMessages;
     341
     342    for I := 0 to 1000000 do
    266343      List.Add(1);
    267344    StartTime := Now;
     
    271348      Inc(I);
    272349    until (Now - StartTime) > OneSecond;
    273     WriteLn('IndexOf: ' + IntToStr(I) + ' ops/sec');
     350    WriteOutput('TListPointer.IndexOf', IntToStr(I) + ' ops/sec');
    274351    List.Clear;
    275352    Application.ProcessMessages;
     353
     354    for I := 0 to 1000000 do
     355    List2.Add(1);
     356    StartTime := Now;
     357    I := 0;
     358    repeat
     359      List2.IndexOf(Pointer(I mod List2.Count));
     360      Inc(I);
     361    until (Now - StartTime) > OneSecond;
     362    WriteOutput('TList.IndexOf', IntToStr(I) + ' ops/sec');
     363    Application.ProcessMessages;
     364
    276365  finally
    277366    List.Free;
    278   end;
    279 
    280   try
    281     List2 := TList.Create;
    282     WriteLn;
    283     WriteLn('Test TList...');
    284     StartTime := Now;
    285     repeat
    286       List2.Add(1);
    287     until (Now - StartTime) > OneSecond;
    288     WriteLn('Add: ' + IntToStr(List2.Count) + ' ops/sec');
    289     List2.Clear;
    290     Application.ProcessMessages;
    291 
    292     StartTime := Now;
    293     repeat
    294       List2.Insert(0, 1);
    295     until (Now - StartTime) > OneSecond;
    296     WriteLn('Insert: ' + IntToStr(List2.Count) + ' ops/sec');
    297     List2.Clear;
    298     Application.ProcessMessages;
    299 
    300     for I := 0 to 1000000 do
    301       List2.Add(1);
    302     StartTime := Now;
    303     I := 0;
    304     repeat
    305       List2.Delete(0);
    306       Inc(I);
    307     until (Now - StartTime) > OneSecond;
    308     WriteLn('Delete: ' + IntToStr(I) + ' ops/sec');
    309     Application.ProcessMessages;
    310 
    311     for I := 0 to 1000000 do
    312     List2.Add(1);
    313     StartTime := Now;
    314     I := 0;
    315     repeat
    316       List2.Move(300000, 700000);
    317       Inc(I);
    318     until (Now - StartTime) > OneSecond;
    319     WriteLn('Move: ' + IntToStr(I) + ' ops/sec');
    320     Application.ProcessMessages;
    321 
    322     for I := 0 to 1000000 do
    323     List2.Add(1);
    324     StartTime := Now;
    325     I := 0;
    326     repeat
    327       List2.Exchange(300000, 700000);
    328       Inc(I);
    329     until (Now - StartTime) > OneSecond;
    330     WriteLn('Exchange: ' + IntToStr(I) + ' ops/sec');
    331     Application.ProcessMessages;
    332 
    333     for I := 0 to 1000000 do
    334     List2.Add(1);
    335     StartTime := Now;
    336     I := 0;
    337     repeat
    338       List2.IndexOf(Pointer(I mod List.Count));
    339       Inc(I);
    340     until (Now - StartTime) > OneSecond;
    341     WriteLn('IndexOf: ' + IntToStr(I) + ' ops/sec');
    342     Application.ProcessMessages;
    343 
    344   finally
    345367    List2.Free;
    346368  end;
     
    355377  R: string;
    356378begin
    357   MemoOutput.Clear;
     379  ListViewOutput.Clear;
    358380  try
    359381    Dictionary := TDictionaryStringString.Create;
    360     WriteLn('TDictionaryStringString...');
    361     I := 0;
    362     StartTime := Now;
    363     repeat
    364       Dictionary.Add(IntToStr(I), IntToStr(I));
    365       I := I + 1;
    366     until (Now - StartTime) > OneSecond;
    367     WriteLn('Add pair: ' + IntToStr(Dictionary.Count) + ' ops/sec');
    368     Application.ProcessMessages;
    369 
    370     I := 0;
    371     StartTime := Now;
    372     repeat
    373       R := Dictionary.Values[IntToStr(I mod Dictionary.Count)];
    374       I := I + 1;
    375     until (Now - StartTime) > OneSecond;
    376     WriteLn('Values: ' + IntToStr(I) + ' ops/sec');
    377     Application.ProcessMessages;
    378 
    379     I := 0;
    380     StartTime := Now;
    381     repeat
    382       R := Dictionary.Keys[I mod Dictionary.Count];
    383       I := I + 1;
    384     until (Now - StartTime) > OneSecond;
    385     WriteLn('Keys: ' + IntToStr(I) + ' ops/sec');
    386     Application.ProcessMessages;
    387 
    388     I := 0;
    389     StartTime := Now;
    390     repeat
    391       R := Dictionary.Items[I mod Dictionary.Count].Value;
    392       I := I + 1;
    393     until (Now - StartTime) > OneSecond;
    394     WriteLn('Values by index: ' + IntToStr(I) + ' ops/sec');
    395     Application.ProcessMessages;
    396   finally
    397     Dictionary.Free;
    398   end;
    399 
    400   try
    401382    Dictionary2 := TStringList.Create;
    402383    Dictionary2.NameValueSeparator := '|';
    403     WriteLn;
    404     WriteLn('TStringList...');
     384
     385    I := 0;
     386    StartTime := Now;
     387    repeat
     388      Dictionary.Add(IntToStr(I), IntToStr(I));
     389      I := I + 1;
     390    until (Now - StartTime) > OneSecond;
     391    WriteOutput('TDictionaryStringString.Add', IntToStr(Dictionary.Count) + ' ops/sec');
     392    Application.ProcessMessages;
     393
    405394    I := 0;
    406395    StartTime := Now;
     
    409398      I := I + 1;
    410399    until (Now - StartTime) > OneSecond;
    411     WriteLn('Add pair: ' + IntToStr(Dictionary2.Count) + ' ops/sec');
     400    WriteOutput('TStringList.Add', IntToStr(Dictionary2.Count) + ' ops/sec');
     401    Application.ProcessMessages;
     402
     403    I := 0;
     404    StartTime := Now;
     405    repeat
     406      R := Dictionary.Values[IntToStr(I mod Dictionary.Count)];
     407      I := I + 1;
     408    until (Now - StartTime) > OneSecond;
     409    WriteOutput('TDictionaryStringString.Values', IntToStr(I) + ' ops/sec');
    412410    Application.ProcessMessages;
    413411
     
    418416      I := I + 1;
    419417    until (Now - StartTime) > OneSecond;
    420     WriteLn('Values: ' + IntToStr(I) + ' ops/sec');
     418    WriteOutput('TStringList.Values', IntToStr(I) + ' ops/sec');
     419    Application.ProcessMessages;
     420
     421    I := 0;
     422    StartTime := Now;
     423    repeat
     424      R := Dictionary.Keys[I mod Dictionary.Count];
     425      I := I + 1;
     426    until (Now - StartTime) > OneSecond;
     427    WriteOutput('TDictionaryStringString.Keys', IntToStr(I) + ' ops/sec');
    421428    Application.ProcessMessages;
    422429
     
    427434      I := I + 1;
    428435    until (Now - StartTime) > OneSecond;
    429     WriteLn('Keys: ' + IntToStr(I) + ' ops/sec');
     436    WriteOutput('TStringList.Keys(Names)', IntToStr(I) + ' ops/sec');
     437    Application.ProcessMessages;
     438
     439    I := 0;
     440    StartTime := Now;
     441    repeat
     442      R := Dictionary.Items[I mod Dictionary.Count].Value;
     443      I := I + 1;
     444    until (Now - StartTime) > OneSecond;
     445    WriteOutput('TDictionaryStringString.Items', IntToStr(I) + ' ops/sec');
    430446    Application.ProcessMessages;
    431447
     
    436452      I := I + 1;
    437453    until (Now - StartTime) > OneSecond;
    438     WriteLn('Values by index: ' + IntToStr(I) + ' ops/sec');
    439     Application.ProcessMessages;
    440   finally
     454    WriteOutput('TStringList.Items(ValueFromIndex)', IntToStr(I) + ' ops/sec');
     455    Application.ProcessMessages;
     456
     457  finally
     458    Dictionary.Free;
    441459    Dictionary2.Free;
    442460  end;
     
    452470  List: TListString;
    453471begin
    454   MemoOutput.Clear;
    455   WriteLn('TListString test');
     472  ListViewOutput.Clear;
     473  WriteOutput('TListString test');
    456474  List := TListString.Create;
    457475  with List do try
    458476    AddArray(['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven']);
    459     WriteLn('Count: ' + IntToStr(Count));
    460     WriteLn('Implode: ' + Implode(',', StrToStr));
    461     WriteLn('Reverse');
     477    WriteOutput('Count', IntToStr(Count));
     478    WriteOutput('Implode', Implode(',', StrToStr));
     479    WriteOutput('Reverse');
    462480    Reverse;
    463     WriteLn('Implode: ' + Implode(',', StrToStr));
    464     WriteLn('First: ' + First);
    465     WriteLn('Last: ' + Last);
     481    WriteOutput('Implode', Implode(',', StrToStr));
     482    WriteOutput('First', First);
     483    WriteOutput('Last', Last);
    466484    MoveItems(2, 3, 3);
    467     WriteLn('Implode: ' + Implode(',', StrToStr));
     485    WriteOutput('Implode', Implode(',', StrToStr));
    468486  finally
    469487    Free;
     
    475493end;
    476494
    477 procedure TMainForm.WriteLn(Text: string = '');
    478 begin
    479   MemoOutput.Lines.Add(Text);
     495procedure TMainForm.WriteOutput(Text1: string = ''; Text2: string = '');
     496var
     497  NewItem: TListItem;
     498begin
     499  NewItem := ListViewOutput.Items.Add;
     500  NewItem.Caption := Text1;
     501  NewItem.SubItems.Add(Text2);
    480502end;
    481503
Note: See TracChangeset for help on using the changeset viewer.