Page 1 of 1

[byval] attribute

Posted: 23 Nov 2016 13:22
by Peter Muraya
Hi Thomas,
I understand what the [in] and [out] attributes do in predicate arguments, but not [byval]. What does it mean and how would I use it?

Posted: 24 Nov 2016 12:58
by Thomas Linder Puls
As the language reference states about byVal:
An argument is transferred directly on the stack rather than using a pointer.
If that doesn't mean anything to you, then you shouldn't use it ;-).

It is not intended for normal programming.

It is only intended for interfacing to foreign code (like the Windows API), and has to do with confirming to such foreign codes calling conventions. You will notice that it can only be used in combination with foreign calling conventions stdcall, apicall and c.

Posted: 2 Dec 2016 6:23
by Peter Muraya
Thank you Thomas.