MSTRLIST

Version 2.1,  11.10.1996,  PostCardWare, Albrecht Mengel, mengel@stat-econ.uni-kiel.de
If you have problems/ideas with mStrList, please feel free to email me!

**** CHANGED:  TMSortType -> TLSortType, soString -> sString, ... , soDate -> sDate  ******
     This was important, otherwise mStrGrid Users should manually include mStrList to their
     USES list, when using setting mStrGrid1.KeyType values. Sorry! (The compiler will warn you)
     If needed you can typecast list.KeyType:=TLSortType(grid.KeyType) or
     grid.KeyType:=TMSortType(list.KeyType). I'll hold TMSortType and TLSortType compatible.

New since last major version: SortDescending, Sort Date.

Tips: - Just add MStrList to the USES-List. Check, that your Project Path sees MStrList.pas
        Then you can easy use this enhanced StringList for your own use.
      - You can copy MStrList as to many StringLists (for TListBox or TMemo). Usage:
	var L:TmStrList;
        begin L:=TmStrList.create; {Get Memory and create the List}
	      try {Set several properties of L, f.x. L.KeyType:=soNumeric}
	          {Call some methods of L, f.x. L.add(something); ... ; L.sorted:=true};
	          Memo1.lines:=L;  {Here the contents of the memo is replaced}
                  ListBox1.items:=L; {The ListBox can get its items too from L}
              finally
                  L.free {Detroy the list and free the memory}
              end {If you trust in you and me you could omit the try-finally-end construction,
        end       {but better save then sorry}

This is a sister of TStringList with some new sorting properties:

property KeyType:(soString,soStringCaseSensitive,soNumeric,soDate)
   This is the kind, how the keys (and cells) are compared.
   If you work with soNumeric, all non numbers get the same value 0.
      As these zero values would flip in random order a (case insensitive) string sort
      is performed after. So, first come the negatives, then the strings, and thereafter
      the positives.
   Date sorting works with the Delphi StrToDateTime function. It should work with your own
      date format you use (See the Delphi help for the global date format Delphi uses)
property KeyPos:Integer;
property KeyLen:Integer;
   Here you may define, which substring of the cells is used to comparision.
   (Default is KeyPos=1 & KeyLen=MaxInt)
property ScipFirst:Integer;
   Here you can exclude some first entries from sorting.
   (It is used by mStringGrid for excluding fixed rows/cols)
property SortDescending:Boolean;
   false (default) : Ascending sorting order
   true            : Descending sorting order

When you set sorting to true then the sorting is done with the new properties.
The default settings result in the same sorting as TStringList does.

TmStrList is a copy of TStringList found in \source\vcl\grids.pas with some additional
entries.
I had a problem with compiling TStringList.Changed and TStringList.Changing:
They call the property FUpdateCount which I could not reach:

procedure TmStrList.Changed;
begin
  if {!(FUpdateCount = 0) and} Assigned(FOnChange) then FOnChange(Self);
end;

procedure TmStrList.Changing;
  ... the same ...

Why, (the hell!) can Delphi library compile that and I not ??????

Is there anyone to fix that problem???

Software development:

Programming consumes time, and programmed components save time.
If you like my components feel free to send me some acknowledgment.
I accept post cards of your town, money or cheques (2$ up to 20$),
if you use mStrGrid for private.
For commercial use I give this code free for $20 (or more).
This is a motivation for me to continue developing for you.

If you have some ideas to improve mStrList, mStrGrid or any other component
send me a message.

The mStrList is copyright (C) 1996, by Albrecht Mengel. You may give copies to
others by copying the original, unmodified zip file. You may use this component
in your own projects free of charge as long as those projects are public domain,
freeware or shareware project.

The author of mStrList (A. Mengel) makes no warranty of any kind,
expressed or implied, including without limitation any warranties of merchantability
and/or fitness for a particular purpose. In no event will the author be liable to you
for any additional damages, including any lost profits, lost savings, or other
incidental or consequential damages arising from the use of, or inability to use,
this software and its accompanying documentation, even if the author has been advised
of the possibility of such damages.

Albrecht Mengel, University of Kiel, Germany
Institute for Statistics & Economics
Olshausenstrasse 40-60,
D-24098 Kiel
Tel. +49-431-880-2424
Fax. +49-431-880-2673
Email: mengel@stat-econ.uni-kiel.de
http://www.stat-econ.uni-kiel.de/pers/mengel.htm
