> I remember something like this in RTTI though but can't find it in your
docs yet for generics.
{$mode objfpc}
uses
typinfo;
generic procedure Add;
begin
if TypeInfo(T) = TypeInfo(Integer) then WriteLn('an integer');
if TypeInfo(T) = TypeInfo(String) then WriteLn('a string');
end;
begi
Inside a generic procedure (no objects used just a procedure) is there a
way to check which type the code is being used for such as:
generic procedure Add();
begin
if type = integer then...
if type = string then...
begin
// specialized code for that type only
end
end;
I remember so
On 2020-08-24 14:01, nore...@z505.com wrote:
I've noticed some problem with another hashlist that after adding
about 2000 items to it, it starts to have problems.
BTW, sorry to be more clear I meant I used another hashlist unit, not
the contnrs one but another open source public domain one
T
Am 24.08.2020 um 21:47 schrieb Lars via fpc-pascal:
Since FPC has no associative array I was thinking that the closest is
TStringList with name/value pairs.
Then there is a hashlist in contnrs.
Maybe an associative array means you don't have to implement it using
hashes in order for it to wor
Am 24.08.2020 um 21:01 schrieb Lars via fpc-pascal:
I've noticed some problem with another hashlist that after adding
about 2000 items to it, it starts to have problems. There are
duplicates added (possibly a collision?)
Is there a such thing as a perfect hashlist which never has a
collision,
On Mon, Aug 24, 2020 at 9:25 PM Lars via fpc-pascal
wrote:
> Is there a such thing as a perfect hashlist which never has a collision,
No, there are infinite possible items you can add to a haslist, but
only a finite number of available hashes.
It's the pigeon hole principle:
https://en.wikipedia
Since FPC has no associative array I was thinking that the closest is
TStringList with name/value pairs.
Then there is a hashlist in contnrs.
Maybe an associative array means you don't have to implement it using
hashes in order for it to work?
If there is a need for one I might write one as
I've noticed some problem with another hashlist that after adding about
2000 items to it, it starts to have problems. There are duplicates added
(possibly a collision?)
Is there a such thing as a perfect hashlist which never has a collision,
or will they always have problems... In that case a
On Mon, 24 Aug 2020 09:59:19 +0200, Mattias Gaertner via fpc-pascal
wrote:
>> Can I copy this file from an RPi3B where I have installed the same
>> versions of Lazarus and Fpc in the same file locations (I use the same
>> install scripts on all RPi:s)?
>
>Yes.
>After start fix the paths in Tools
Thanks to Sven & Michael for commenting.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
On Mon, 24 Aug 2020 09:12:19 +0200
Bo Berglund via fpc-pascal wrote:
> Tonight there was a power outage in my home where I have a RaspberryPi
> 4B development system with Lazarus 2.0.8 and Fpc 3.0.4.
>
> When it happened the system was running including Lazarus.
> Now when I start Lazarus I get
Tonight there was a power outage in my home where I have a RaspberryPi
4B development system with Lazarus 2.0.8 and Fpc 3.0.4.
When it happened the system was running including Lazarus.
Now when I start Lazarus I get to a dialog saying:
12 matches
Mail list logo