Forum Migration Notice
Update (2026-01-21): The user forums are now in read-only mode pending the data migration.

Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.

We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.

Conditional procedure argument

Hi,

could you please provide an example, how to use a conditional procedure argument?
The "conditional procedure argument" is described as part of the language in the "RAPID kernel" topic Statements/Procedure call:

'\' <identifier> '?' ( <parameter> | <VAR> )<p><conditional procedure argument> ::=</p>


Tagged:

Comments

  • Ok, got it by myself
    MODULE TestModule<br>&nbsp;&nbsp;&nbsp; PROC Main()&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR wobjdata ok2;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TPErase;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TestProc \ok:=ok2;<br>&nbsp;&nbsp;&nbsp; ENDPROC<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; PROC TestProc(\wobjdata wobj,\wobjdata ok)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TestProc2 \wobj?wobj, \ok?ok;<br>&nbsp;&nbsp;&nbsp; ENDPROC<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; PROC TestProc2(\wobjdata wobj,\wobjdata ok)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF Present(wobj) THEN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TPWrite "wobj present";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF Present(ok) THEN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TPWrite "ok present";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF<br>&nbsp;&nbsp;&nbsp; ENDPROC<br>ENDMODULE