[Solved] 'Restart' keyword
Posted: Mon Dec 01, 2014 7:46 pm
Hello.
I just programmed this...
...but it would be so much quicker like this...
What do you think?
-------------------
Here's the above code in a testable example:
I just programmed this...
Code: Select all
Repeat
Found = #False
ForEach Names$ ()
If Names$ () = Name$
Name$ + "_"
Found = #True
Break
EndIf
Next
Until Not Found
Code: Select all
ForEach Names$ ()
If Names$ () = Name$
Name$ + "_"
Restart
EndIf
Next
-------------------
Here's the above code in a testable example:
Code: Select all
NewList Names$ ()
AddElement (Names$ ())
Names$ () = "Darin"
AddElement (Names$ ())
Names$ () = "Claude"
AddElement (Names$ ())
Names$ () = "Claude"
AddElement (Names$ ())
Names$ () = "Enrico"
Name$ = "Claude"
Repeat
Found = #False
ForEach Names$ ()
If Names$ () = Name$
Name$ + "_"
Found = #True
Break
EndIf
Next
Until Not Found
AddElement (Names$ ())
Names$ () = Name$
ForEach Names$ ()
Debug Names$ ()
Next