How to create a "while" function

Does anyone know how to create a while function?
I’m fine with it using nodes, code blocks, or python, I’d just like to see the general rules for creating something like that.

Section 12 of this document gives a good rundown on how to do it with design script. Likely best to start at the beginning and work your way to that point though.

I recently wrote a good example script utilizing these methods for multiple string replacement, which was posted here:


Thanks a lot!
Even though I haven’t worked it out yet I think this will do so I’ve marked it as a solution.
I’m familiar with most programming in Dynamo’s code nodes, creating a while loop is something I’ve never managed with it, but I guess I’ll skim the rest of the document so I’m certain I won’t miss anything.