在我的"原生"编程语言(RPG)中,我可以编写一个循环,然后离开循环或强制迭代.它有点像GOTO.
dow (x < 999);
read file;
if (%eof);
leave; // Leave the loop
endif;
if (field <> fileField);
iter; // Iterate to the next record
endif;
enddo;
Run Code Online (Sandbox Code Playgroud)
我的问题是,是否有类似的选项是C#.就我而言,我正在使用foreach循环.
Ada*_*ght 18
continue; // Goto the next iteration
break; // Exit the loop
Run Code Online (Sandbox Code Playgroud)