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
- 390 UpFeed
- 17 Tutorials
- 13 RobotApps
- 296 PowerPacs
- 404 RobotStudio S4
- 1.8K Developer Tools
- 245 ScreenMaker
- 2.7K Robot Controller
- 302 IRC5
- 55 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 764 RAPID Programming
- 16 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings