So lets try it out. First, you need to add
exports Add;
to the Setvar project file, so that the function is exported. Save the project and choose Compile/Build all.
The setvar.dll file will be created. Open APW. Choose Data/Load function and select the setvar.dll file. Because we haven't created the resource file yet, you will need to specify the function name and arguments. They are
Function name: Add
Arguments: word
Return: long
Next, drag a calculation icon to the flowline. Add this code:
num1 := 3 num2 := 4 res := Add( WindowHandle )
Close the calc box - you will be asked to create the num1, num2 and res variables. Run the APW file; res should now equal 7. The Add function has retrieved the values of num1 and num2 and returned the result of adding them together.
Next, we will change the Add function so that it sets the result directly, rather than return it.
On to: The SetApwNumber function
Back to: Getting a number value from APW Start