[byval] attribute

Discussions related to Visual Prolog
Peter Muraya
VIP Member
Posts: 146
Joined: 5 Dec 2012 7:29

[byval] attribute

Unread post by Peter Muraya » 23 Nov 2016 13:22

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?
Mutall Data Management Technical Support

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 24 Nov 2016 12:58

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.
Regards Thomas Linder Puls
PDC

Peter Muraya
VIP Member
Posts: 146
Joined: 5 Dec 2012 7:29

Unread post by Peter Muraya » 2 Dec 2016 6:23

Thank you Thomas.
Mutall Data Management Technical Support

Post Reply