NEXT: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
(17 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[:Category:Language|{{Up}}]] | |||
{{Command|syntax=NEXT <variable> | {{Command|syntax=NEXT <variable> | ||
|description=The NEXT command is used in conjunction with the [[FOR]] command to indicate the end of a loop. | |description=:The NEXT command is used in conjunction with the [[FOR]] command to indicate the end of a loop. | ||
|param1=<variable>|param1_desc=The name of the variable that is used in the matching [[FOR]] command. | |param1=<variable>|param1_desc=The name of the variable that is used in the matching [[FOR]] command. | ||
Line 13: | Line 15: | ||
<br> | <br> | ||
:FOR I=1 TO 3 | :FOR I=1 TO 3 | ||
: FOR J=2 TO 8 | :: FOR J=2 TO 8 | ||
: (some macro commands) | ::: (some macro commands) | ||
: NEXT J | :: NEXT J | ||
:NEXT I | :NEXT I | ||
<br> | <br> | ||
: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 macro see [[Modify_Op_Path]] [[Explode_Shape]] [[Calc_Geo_Extents]] [[Cs_List]] [[Debug_Sel_geo]] [[Get_Op_Tool_Path]] [[Global_Local]] [[GlobalLocal_Sub.mac]] [[Print_Geo_Data_To_File]] [[Solid_Type]] [[Wg_List]] | |||
[[Category:Language]] | [[Category:Language]] |
Latest revision as of 14:15, 12 August 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
- FOR J=2 TO 8
- NEXT I
- It is recommended that you indent code inside loops to help show where a loop starts and ends