While Loop
Samucha
✭
in RobotStudio
Hi' All
How to exit while loop and continue next command ?
Example
VAR num sum;
How to exit while loop and continue next command ?
Example
VAR num sum;
PROC testwhile()
WHILE TRUE DO
Incr sum;
IF sum = 10 THEN
TPWrite "Sum :" \Num:= sum;
TPWrite "Sum :" \Num:= sum;
! ---------- Exit while loop and continue command
ENDIF
ENDWHILE
ENDPROC
PROC summ()
testwhile;
TPWrite "Exit loop while";
ENDPROC
Thanks for help.
PROC summ()
testwhile;
TPWrite "Exit loop while";
ENDPROC
Thanks for help.
0
Comments
-
Hello
There is no break command but you could set a condition for the while loop like WHILE NOT sum = 10 THEN
/Pavel0 -
Something like this
VAR num sum;
VAR bool bExit:=FALSE;PROC testwhile()WHILE NOT bExit DOIncr sum;IF sum = 10 THEN
TPWrite "Sum :" \Num:= sum;
bExit:=TRUE;! ---------- Exit while loop and continue commandENDIFENDWHILEENDPROC
PROC summ()
testwhile;
TPWrite "Exit loop while";
ENDPROCPer Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Hi,All
Thanks for help.0
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