User Tools

Site Tools


xrpl:do

Differences

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

Link to this comparison view

Next revision
Previous revision
xrpl:do [2019/03/03 16:43] – created Karsten75xrpl:do [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-<- [[.:prplreference| PRPL reference]] <- [[.:prplreference#program_flow_control|Program Flow Control]] 
- 
-=====  do  ===== 
- 
-^Arguments^Result^Notation^ 
-| Limit, Index | | [ i1 i2 - ] | 
- 
- 
-=== Description === 
-The statements following the do, up to the loop statement, are executed repeatedly. Each iteration (loop), the initial value (Index) is incremented by one at the bottom of the loop and compared to Limit. When Index=Limit, execution will proceed at the first statement following Loop. Loops can be nested, but no more than 3 deep. See also: [[.:i|I]], [[.:j|J]] and [[.:k|K]]. 
- 
-NOTE: Limit comes first, then the initial value (index). This means that the first number should usually be bigger than the second number.  
- 
-=== Examples === 
-<code prpl> 
-do(5 0)  
-   trace(I)  
-loop  
-# Prints: 
-# 0 
-# 1 
-# 2 
-# 3 
-# 4 
- 
- 
-2 0 do 
- I Trace 
- 2 0 do 
- J I Trace2 
- 2 0 do 
- K J I Trace3 
- loop 
- loop 
-loop 
-#Prints: 
-# 0 
-# 0 0 
-# 0 0 0 
-# 0 0 1 
-# 0 1 
-# 0 1 0 
-# 0 1 1 
-# 1 
-# 1 0 
-# 1 0 0 
-# 1 0 1 
-# 1 1 
-# 1 1 0 
-# 1 1 1 
-</code> 
  
xrpl/do.1551649427.txt.gz · Last modified: 2019/03/03 16:43 by Karsten75