次のように、DOS バッチ ファイルで while ループを実行できます。
@REM initialize test value to be "true"
@SET intCounter=1
:while
@REM test condition
@IF %intCounter% GTR 10 (GOTO wend)
@REM procedure where condition is "true"
@echo %intCounter%
@REM set new test value
@SET /a intCounter=intCounter+1
@REM loop
@GOTO while
:wend
@PAUSE
これは 10 回ループします。私の質問は2つあります。
ループの終わりを制御するにはどうすればよいですか。set end =1 を試し、10 を %end% に置き換えてみましたが、うまくいきません。
キーボードからの入力を読み取り、それらを iniCounter に設定して終了する方法。
どうもありがとう。