I'm trying to call a procedure which is is another file. What I've got so far results in an error:
test.p
DEFINE VARIABLE tmp AS CHARACTER.
RUN sumWords.p(INPUT "Hello", INPUT "World", OUTPUT tmp).
DISPLAY tmp.
sumWords.p
PROCEDURE sumWords:
DEFINE INPUT PARAMETER i_firstWord AS CHARACTER.
DEFINE INPUT PARAMETER i_secondWord AS CHARACTER.
DEFINE OUTPUT PARAMETER o_returnWord AS INTEGER.
o_returnWord = i_firstWord + i_secondWord.
END PROCEDURE.
test.p passed parameters to sumWords.p, which didn't expect any. (1005)
You have created an internal procedure "sumWords" in "sumWords.p". sumWords.p does indeed not expect parameters.
Either change sumWords.p and remove the lines PROCEDURE sumWords: and END PROCEDURE.
That way the sumWords.p expects the parameters.
Or change the caller:
DEFINE VARIABLE hSumWords AS HANDLE NO-UNDO.
RUN sumWords.p PERSISTENT SET hSumWords.
RUN sumWords IN hSumWords (INPUT "Hello", INPUT "World", OUTPUT tmp).
DELETE OBJECT hSumWords.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With