Understanding and (Not) Using the Goto Delphi Statement
in TIPS ::
The Goto statement transfers program execution to the statement marked by the specified label.
Read this again! Goto does not "ask questions", it simply forces a jump to some other location in the code block. When badly used Goto could transform your code into a non-readable piece of junk.
Be it bad or good, Goto is in Delphi and you might need to use it, or at least need to understand how it works.
Read the full tip to learn how Goto can be used, and when it should not be used
Related: Poll: Are you using the Goto statement in Delphi? | How I (Almost) Ended Up Using Goto in Delphi code | RTL's flow control routines (Abort, Break, Continue, Exit)


Comments
I never use it as part of the final code, but I use it A LOT for debugging. For that purpose it is very handsome.
Your solution:
if L in LL then
if L.Parent in CC then
Process L as LL ; C as CC
else
if L in CC then GOTO skip
else
skip:
if L in CC then
Process L as CC
else
Process L as any other folder
end
Why not use this?
Wouldn’t this solve your problem?
if (L in LL ) and (L.Parent in CC) then
Process L as LL; C as CC
else if L in CC then
Process L as CC
else
Process L as any other folder
end
Probably I have misunderstod your problem but?
Hi
The quicksort code by Wirth uses goto’s to clearify code.
Btw the best example ever saw was:
if (a=b) then
do something usefull
else
goto end;
:end;