ByVal just means that the parameter is passed to the procedure by value rather than the WD default; by Address.
Look at this for help - http://doc.windev.com/en-US/…
In Wx, instead of using ByVal, you use LOCAL in the procedure definition. Calling the procedure makes no difference.
Also, items passed by Address can be updated by the called procedure. That makes those parameters a two-way variable. Whereas an item passed byValue or Local, cannot be passed back to the calling procedure; making them a one-way communication.
I don't know how much VB you know, so I'll apologize up front for explaining this -
Here is one of the functions from above -
PRIVATE Declare FUNCTION SetCurrentDevice Lib "k8055d.dll" (ByVal CardAddress As Long) As Long
PRIVATE - No one else can change this function
Declare - create a structure for the compiler
FUNCTION - this procedure returns a value and so it is considered as a variable of that type
SetCurrentDevice - Name of the procedure
Lib "k8055d.dll" - the name of the DLL where this function is found
( - start the parameters - the list of values that the procedure needs to work
ByVal CardAddress As Long - the parameter named CardAddress is a 4-byte integer and is passed as a value
) - end of the parameters
As Long - this function returns a 4-byte integer (apiInt_4 in Wx)
In the Wx, it looks like this -
gSetCurrentDevice is API Description
gSetCurrentDevice..DLLName = "k8055d.dll"
gSetCurrentDevice..FunctionName = "SetCurrentDevice"
gSetCurrentDevice..ReturnType = apiInt_4
gSetCurrentDevice..Parameter[1]..Type = apiInt_4
Here is another - PRIVATE Declare Sub SetAllDigital Lib "k8055d.dll" ()
The difference is that this is a Sub(routine) named SetAllDigital
Sub - this procedure does not return a value. It affects some other processes like display or global / class values
Its Api Description would look like this -
gSetAllDigital is API Description
gSetAllDigital..DLLName = "k8055d.dll"
gSetAllDigital..FunctionName = "SetAllDigital"
You should be able to take it from there. There are very few data types to worry about in those functions.
Here is a link to VB data types -
http://msdn.microsoft.com/en-us/library/47zceaw7.aspx (I have this one book marked)
A Single, I believe, is an apiReal_4 - a short Floating point.
HTH,
Chris
--
Sometimes waiting is the best way forward...