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.
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.7K RobotStudio
- 402 UpFeed
- 21 Tutorials
- 16 RobotApps
- 307 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 251 ScreenMaker
- 2.9K Robot Controller
- 368 IRC5
- 92 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 859 RAPID Programming
- 43 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 111 Collaborative Robots
- 5 Job listings