TIntList, an Integer List

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math Topics]   [Library]   [Utilities]

Search

 

Search DelphiForFun.org only

Support DFF

 If you shop at Amazon anyway,  consider using this link. We receive a few cents from each purchase.   Thanks.

In Association with Amazon.com

 

Support DFF

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

 

 

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

 

Search DelphiForFun.org only

 

 

 

 

 

For several years, I've wanted an integer list analog of TStringlist.   I finally decided to write one yesterday and here it is, TIntList.  Most of the code is adapted from TStringlist.  I've tried to include the main features of TStringlist.   You can use it like you would use TStringlist, but with Int64 type integers as the list elements instead of strings.  

I haven't included a Register procedure to make it a component.  For non-visual components, the main disadvantage is that you must manually include the unit name, UIntList, in the Uses statement of your program.

A simple test project is included which generates and displays 100 random integers, sorted or unsorted, with a choice of how duplicates are handled. 

Addendum: October 10, 2001 - Test program extended to include SaveToFile and LoadFromFile buttons to test saving and restoring Integer Lists.  

Addendum March 30, 2005:  The test program was enhanced in several ways.  

bulletThe test lists of integers now have attached objects containing  the numbers written as words. 
bulletCustom Sort  examples show how to sort  the list in alternative sequences.
bulletFind, Add, and Delete function tests are included.
bulletAn exception handler detects and diagnoses attempt to add numbers to a list with Sorted property set to true when the Duplicates property is set to DupError.
bulletThis is the initial program using the DFF Library to obtain the UIntList unit containing the TIntList class definition.   All this means is that UIntList is not included in the zipped source file for the test program.  It is contained in the zipped library file.   

 

Download TIntList Test Source (Requires DFFLIBV02 or later to compile)

Download DFF Library Source  (Current version DFFLibV14 )

 

 

Created: February 21, 2001

Modified: November 07, 2008

 

 

 

  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright © 2000-2013, Gary Darby    All rights reserved.