Difference between revisions of "Build a Loop"
From ArcoWiki
m (Links to existing pages added by LinkTitles bot.) |
|||
(3 intermediate revisions 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]] |
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,i
DECL/CHAR,20,elnm
DECL/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,0
F(POI_2)=FEAT/POINT,CART, 4.444,5.555,6.666, 0,0,0
F(POI_3)=FEAT/POINT,CART, 7.777,8.888,9.999, 0,0,0
FA(POI_1)=FEAT/POINT,CART, 1.111,2.222,3.333, 0,0,0
FA(POI_2)=FEAT/POINT,CART, 4.444,5.555,6.666, 0,0,0
FA(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 cycle
elnm=ASSIGN/CONCAT('poi_',STR(i))
xx=OBTAIN/FA(@elnm),3
yy=OBTAIN/FA(@elnm),4
zz=OBTAIN/FA(@elnm),5
elnm=ASSIGN/CONCAT('newpoi_',STR(i))
F(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
FA(@elnm)=FEAT/POINT,CART, xx,yy,zz, 0,0,0
ENDDO