[fpc-pascal] List of Integer/Double etc

Sven Barth pascaldragon at googlemail.com
Wed Oct 12 14:29:09 CEST 2011


Am 12.10.2011 14:16, schrieb Leonardo M. Ramé:
>> ________________________________
>> From: Sven Barth<pascaldragon at googlemail.com>
>> To: fpc-pascal at lists.freepascal.org
>> Sent: Wednesday, October 12, 2011 9:12 AM
>> Subject: Re: [fpc-pascal] List of Integer/Double etc
>>
>> Am 12.10.2011 14:08, schrieb Leonardo M. Ramé:
>>> Hi, I'm wondering if the rtl or a standard package includes classes for
>>> handling lists of Integer, Double, and other types. Similar to
>>> TStringList, but for numerical types.
>>
>> Using generics this is easy:
>>
>> === source begin ===
>>
>> uses
>>    fgl;
>>
>> type
>>    TIntegerList = specialize TFPList<Integer>;
>>    TDoubleList = specialize TFPList<Double>;
>>
>> === source end ===
>>
>> Regards,
>> Sven
>>
>
>
> Thanks, I'll try that.

Please note: it needs to be "TFPGList" and not "TFPList". I missed a 
character there.

Regards,
Sven




More information about the fpc-pascal mailing list