Board index » cppbuilder » Using the _pascal keyword...

Using the _pascal keyword...


2005-07-10 05:40:22 PM
cppbuilder0
Can anyone show me an example of using the _pascal
keyword in BCB? i cannot seem to find anything within
the help.
 
 

Re:Using the _pascal keyword...

At 11:40:22, 10.07.2005, qyte wrote:
Quote
Can anyone show me an example of using the _pascal
keyword in BCB? i cannot seem to find anything within
the help.
int __pascal myAddition(int a, int b)
{
return a + b;
}
__pascal is a calling convention (like __cdecl, __stdcall) which is
actually hardly ever used in Win32. It passes arguments from left to
right, instead of the usual right to left C uses. It also clears the
stack after use, i.e. it is more or less like __stdcall in that respect.
Unless you have to interface to code (in a DLL or so) that, for some
reason or other (I can't think of any, but who knows?) uses it, you can
just as well forget about it.
--
Rudy Velthuis [TeamB] velthuis.homepage.t-online.de
"An inconvenience is only an adventure wrongly considered; an adventure
is an inconvenience rightly considered."
- Gilbert Keith Chesterton (1874-1936)
 

Re:Using the _pascal keyword...

At 11:40:22, 10.07.2005, qyte wrote:
Quote
Can anyone show me an example of using the _pascal
keyword in BCB? i cannot seem to find anything within
the help.
PS: if you ever see a declaration using PASCAL, don't make the mistake to
thik that actually uses the _pascal calling convention. In Win32, the
PASCAL macro actually means stdcall.
Pascal (_pascal, __pascal) was a calling convention used in many 16 bit
Windows APIs. Don't use it nowadays.
--
Rudy Velthuis [TeamB] velthuis.homepage.t-online.de
"This book fills a much-needed gap."
-- Moses Hadas (1900-1966) in a review
 

{smallsort}