Optional parameters initialization
Hello all,
I'd like to know how to assign a predefined value to an optional parameter, I've tried to use this syntax, but it doesn't work:
PROC SetVel(num nC, num nH, num nV, ool b1 := TRUE)
It is very important for me to be able to know that the optional value will always be one determined value if it is not directly specified by the user in the procedure call.
Thank you in advance for your time and help.
Comments
-
I've seen how to do it, I cannot initialize the values directly in the declaration, but I can not initialize them and use a dummy variable for each of them inside the function/procedure:
PROC SetVel(num nC, num nH, num nV, ool b1)
VAR bool bAux := FALSE;
IF (Present b1) THEN
bAux := b1;
ENDIF
! now I can work with bAux, and it is always initialized at FALSE...
0 -
Check this out
PROC rSmartTacValueDisplay(num nNumber\INOUT robtarget EndX\INOUT robtarget EndY\INOUT robtarget EndZ)IF PRESENT(EndX) AND PRESENT(EndY) THEN!ENDIFENDPROC0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings