NEXT: Difference between revisions

From Macros Wiki
Jump to navigationJump to search
ConnerO (talk | contribs)
No edit summary
ConnerO (talk | contribs)
No edit summary
Line 20: Line 20:
:It is recommended that you indent code inside loops to help show where a loop starts and ends  
:It is recommended that you indent code inside loops to help show where a loop starts and ends  


:For an example in a real macro see [[Modify_op_path]] or [[Explode_Shape]]
:For an example in a real macro see [[Modify_op_path]] or [[Explode_Shape]] or [[Calc_Geo_Extents]]




[[Category:Language]]
[[Category:Language]]

Revision as of 20:44, 29 July 2010

Command

NEXT <variable>


The NEXT command is used in conjunction with the FOR command to indicate the end of a loop.

Parameters

<variable>
The name of the variable that is used in the matching FOR command.

Example

FOR I=1 TO 3
(some macro commands)
NEXT I


You can "nest" loops (one loop inside another)


FOR I=1 TO 3
FOR J=2 TO 8
(some macro commands)
NEXT J
NEXT I


It is recommended that you indent code inside loops to help show where a loop starts and ends
For an example in a real macro see Modify_op_path or Explode_Shape or Calc_Geo_Extents