Difference between revisions of "Build a Loop"
From ArcoWiki
m (3 revisions imported) |
|||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
'''[[Build a Loop]]''' is the technique to repeate a sequence of instructions a certain number of times based on an initial and limit value and a specified increment.<br/> | '''[[Build a Loop]]''' is the technique to repeate a sequence of instructions a certain number of times based on an initial and limit value and a specified increment.<br/> | ||
| − | It is important to declare all the loop variables.<br/> | + | It is important to declare all the loop [[variables]].<br/> |
The generic statement is <code>DO/ index variable, initial value, limit value, increment</code>.<br/> | The generic statement is <code>DO/ index variable, initial value, limit value, increment</code>.<br/> | ||
| Line 30: | Line 30: | ||
::::<code> FA(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0</code> | ::::<code> FA(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0</code> | ||
::<code>ENDDO</code> | ::<code>ENDDO</code> | ||
| + | |||
| + | [[it:Costruisci un anello]] | ||
| + | [[zh-cn:建立一个循环]] | ||
| + | [[pt:Construa um Loop]] | ||
| + | [[de:Erstellen Sie eine Schleife]] | ||
| + | [[es :Construye un bucle]] | ||
| + | [[en:Build a Loop]] | ||
[[Category:Dmis_Tutorial]] | [[Category:Dmis_Tutorial]] | ||
Latest revision as of 09:41, 1 June 2018
Build a Loop is the technique to repeate a sequence of instructions a certain number of times based on an initial and limit value and a specified increment.
It is important to declare all the loop variables.
The generic statement is DO/ index variable, initial value, limit value, increment.
$$ Example of a Do Loop
DECL/INTGR,iDECL/CHAR,20,elnmDECL/DOUBLE,xx,yy,zz
$$ This is to create some dummy points.
F(POI_1)=FEAT/POINT,CART, 1.111,2.222,3.333, 0,0,0F(POI_2)=FEAT/POINT,CART, 4.444,5.555,6.666, 0,0,0F(POI_3)=FEAT/POINT,CART, 7.777,8.888,9.999, 0,0,0FA(POI_1)=FEAT/POINT,CART, 1.111,2.222,3.333, 0,0,0FA(POI_2)=FEAT/POINT,CART, 4.444,5.555,6.666, 0,0,0FA(POI_3)=FEAT/POINT,CART, 7.777,8.888,9.999, 0,0,0
$$ DO/ index variable, initial value, limit value, increment
DO/i,1,3,1$$ commands executed during each Do cycleelnm=ASSIGN/CONCAT('poi_',STR(i))xx=OBTAIN/FA(@elnm),3yy=OBTAIN/FA(@elnm),4zz=OBTAIN/FA(@elnm),5elnm=ASSIGN/CONCAT('newpoi_',STR(i))F(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0FA(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
ENDDO