Are these also called with @ or something else?
I think that in Delphi it is enough to use the variable name in all
Is there an authoritative document describing this for FPC somewhere?
My current case is sending data from a thread to an event in the main
GUI app where the data are located in a TBytes object and I don't want
to copy the data unneccesarily...
I would like to supply the thread buffer to the event so that the
event procedure can copy the data into a local array and process that.
But if I declare the event procedure without using var I am afraid
that just using the buffer as an argument will make the compiler
*copy* the data into the call and then there will be two copy
> Coming from Delphi I am a bit confused about the syntax when dealing
> with procedure arguments specified as var...
FPC is exactly the same regarding this.
> In Delphi this is all taken care of by the compiler and the
> declaration of the procedure tells it how to deal with the arguments.
> Like so:
> procedure DoSomething(var Cnt: integer);
> called in FPC by:
No it is not.
> But in Delphi it is just:
It is the same in FPC.
> OK, I can live with this, but next comes objects and dynamic arrays
> and such...
> When is it appropriate to use @ and when should it not be used?
> procedure SendData(var Buf: TBytes);
> procedure DigOutStuff(var MyCase: TCaseObject);
> Are these also called with @ or something else?
No, why do you think so ?
> I think that in Delphi it is enough to use the variable name in all
It is exacly the same in FPC.
The only place where FPC differs from Delphi is when you assign a procedure
to a procedural variable.
p : Procedure;
> Is there an authoritative document describing this for FPC somewhere?