RobotStudio event

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