<- PRPL reference <- Program Flow Control

while

ArgumentsResultNotation
[ - ]

Description

Beginning of a while loop. The statements between a 'while' and a 'repeat' should ultimately push a value to the stack that will determine if the loop executes the body of the 'repeat' block.

Examples

5 ->y 
while 
	<-y gt(0) 		#is y greater than zero? 
repeat 				#repeat this section of code 
	trace(<-y) 
	<-y sub(1) ->y 	#subtract 1 from y so we don't end in infinite loop 
endwhile