Michael - I see you are one of the authors of fpc (thank you), so I assume your
statement is true by virtue of "inside knowledge". But this is a concern. As
I'm sure you will know, in Delphi globals are always initialised to zero - and
in my experience (almost 15 years with a 30-strong Delphi
Hi,
I submitted a TStringHashMap class to CCR. I also created a wiki page:
http://wiki.lazarus.freepascal.org/StringHashMap
I made a comprehensive demo program for it. It should be good now.
I found some hashed list and similar classes from FPC sources (with no
documentation) but no hash map
Okay, I am going to call bullshit on you. This is the second time (in
a few weeks) where you've replied to something I've written with wrong
information.
This first time concerning the topic "const records passed
incorrectly" you said, "It is nowhere written in the Delphi specs that
const paramet
On Sat, 28 Nov 2009, Anthony Walter wrote:
That should be removed, actually.
I'll take that as an admission that you were wrong. It's in the
specification, lot's of code uses the feature, and it works the way I
described.
I'm not admitting anything here, I am attempting to enlighten you :-
> That should be removed, actually.
I'll take that as an admission that you were wrong. It's in the
specification, lot's of code uses the feature, and it works the way I
described.
Changing the specification to match your argument is stupid.
___
fpc-pas
On Sat, 28 Nov 2009, Anthony Walter wrote:
This is not guaranteed in any way. It happens to be so most of the time,
but your code should never assume this is so, except for global Ansistring
variables.
If all globals weren't initialized to 0 a lot of code from lots of
people would potentiall
> This is not guaranteed in any way. It happens to be so most of the time,
> but your code should never assume this is so, except for global Ansistring
> variables.
If all globals weren't initialized to 0 a lot of code from lots of
people would potentially be in trouble. I've been using Pascal/Del
On Sat, 28 Nov 2009, Anthony Walter wrote:
PrivateMyVariableSet is not intialised, so will have an undefined
(random) value when InitMyVariable is first called.
Mattias' code given earlier avoids this problem.
Bzzzt. Wrong.
Global variables (even in the implementation section) are always
in
> PrivateMyVariableSet is not intialised, so will have an undefined
> (random) value when InitMyVariable is first called.
> Mattias' code given earlier avoids this problem.
Bzzzt. Wrong.
Global variables (even in the implementation section) are always
initialized to 0.
___
On Sat, 28 Nov 2009 12:10:48 -0500
Anthony Walter wrote:
> procedure InitMyVariable(Value: T);
> function MyVariable: T;
>
> implementation
>
> var
> PrivateMyVariable: T;
> PrivateMyVariableSet: Boolean;
>
> procedure InitMyVariable(Value: T);
> begin
> if not PrivateMyVariableSet then
procedure InitMyVariable(Value: T);
function MyVariable: T;
implementation
var
PrivateMyVariable: T;
PrivateMyVariableSet: Boolean;
procedure InitMyVariable(Value: T);
begin
if not PrivateMyVariableSet then
PrivateMyVariable := Value;
PrivateMyVariableSet := True;
end;
function MyVa
You can use read function:
var
DirectAccessToValue: T;
function Value: T; inline;
begin
Result := DirectAccessToValue;
end;
begin
...
DirectAccessToValue := ...;
...
DoSomething(Value);
end.
On Sat, Nov 28, 2009 at 13:55, Markus Glugla wrote:
> Hello,
>
> is it possible to set a v
On Sat, 28 Nov 2009 15:07:42 +0100
Mattias Gaertner wrote:
> On Sat, 28 Nov 2009 14:58:26 +0100
> Jürgen Hestermann wrote:
>
> > > is it possible to set a variable in a programm as a readonly variable?
> Use the following:
>
> property MyVar: integer read FMyVar write SetMyVar;
>
> And in Se
On Sat, 28 Nov 2009 14:58:26 +0100
Jürgen Hestermann wrote:
> > is it possible to set a variable in a programm as a readonly variable?
>
> Not that I am aware of. But for what reason do you want such a behaviour?
>
> And if I think it over, this can only work at runtime (letting the program
>
is it possible to set a variable in a programm as a readonly variable?
Not that I am aware of. But for what reason do you want such a behaviour?
And if I think it over, this can only work at runtime (letting the program
crash on the second assignment). At compile time the compiler may not ex
Hello,
is it possible to set a variable in a programm as a readonly variable?
I would set a variable at a position in the runing programm. Since this
time the variable should be readonly. The next set of the variable
should produce an error.
In bash programming you found a command "readonly" mak
Hi Andrew
On Thu, Nov 26, 2009 at 4:48 AM, Andrew Hall wrote:
> 1) Always reference your host class through an interface you know will be
> implemented by the host class, therefore calling "as" from this interface
> will always find any of the interfaces your class may support. The easiest
> wo
And there are many reasons why there are so many string types nowadays.
True.
Simply use {mode objfpc}{$h+} like lazarus suggests.
I think the root cause of all these problems are generic types. They cause more
trouble than they avoid. I would suggest that noone never uses such generic
typ
18 matches
Mail list logo