Passing numeric datatypes
The following statement declares the external function TEMP in
PowerBuilder. This function returns an integer and expects an integer
argument to be passed by reference:
1 |
FUNCTION int TEMP(ref int degree) LIBRARY "LibName.DLL" |
The same statement in C would be:
1 |
int _stdcall TEMP(int * degree) |
Since the argument is passed by reference, the function can
change the contents of the argument, and changes made to the argument
within the function will directly affect the value of the original
variable in PowerBuilder. For example, the C statement *degree = 75
would
change the argument named degree to 75 and return 75 to PowerBuilder.
The following statement declares the external function TEMP2 in PowerBuilder.
This function returns an Integer and expects
an Integer argument to be passed by value:
1 |
FUNCTION int TEMP2(int degree) LIBRARY "LibName.DLL" |
The same statement in C would be:
1 |
int _stdcall TEMP2(int degree) |
Since the argument is passed by value, the function can change
the contents of the argument. All changes are made to the local
copy of the argument; the variable in PowerBuilder is not affected.