Overlapping conditional jumps

0 votes
asked May 20, 2016 in Bug by anonymous
Hi! I can't figure out how should I describe an algorithm in plantuml. This is a simplifed version I hope is the same (to capture the problem step 1 and step 2 has to be separated): step 0 A = 0, B = 0 step 1 A = A +1 step 2 B = B + 1 step 3 if (A < 10) goto step 1 step 4 if (B < 10) goto step 2 step 5 stop

1 Answer

0 votes
answered May 20, 2016 by plantuml (294,960 points)

Try to express your algorithm without goto.
(Not easy in your example, but not impossible...)

Goto is generally considered as not good practice. The real issue is that it hides the intention of your program.
(see http://forums.devshed.com/beginner-programming/790131-goto-bad-programming-practice-post2605339.html for more details).

Note that we will probably in some future add goto support into PlantUML, but on on short term... Sorry about that!
 

commented May 20, 2016 by anonymous
Thanks for the response!
I just follow a standardized algorithm so I can't change it unfortunately.
I have tried the goto support but thought the intention was not so clear and more messed up the diagram (perhaps not so easy to place the arrow from goto to label)
Plantuml is a great tool! Keep up the good work!
...