User Tools

Site Tools


crpl:docs:while

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
crpl:docs:while [2013/01/14 14:05] – created virgilwcrpl:docs:while [2021/02/05 11:43] (current) – Rmoved discussion tag Karsten75
Line 1: Line 1:
-TODO+ 
 +<- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#flow_control|Flow Control]] 
 +=====  while  ===== 
 + 
 +^Arguments^Result^Notation^ 
 +| | |''-- ''
 + 
 + 
 +=== 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 === 
 +<code> 
 +# outputs a set of descending numbers on the trace stack  
 +ShowTraceLog  
 +ClearTraceLog  
 +5 ->y #create temp variable "y"  
 +while <-y 0 gt # is y greater than zero?  
 + repeat #repeat this section of code  
 + <-y trace  
 + <-y 1 sub ->y #subtract 1 from y so we don't end in infinite loop  
 + endwhile #rinse and repeat until y is zero. 
 +</code>  
crpl/docs/while.1358190352.txt.gz · Last modified: 2014/10/01 15:02 (external edit)