[bat ] 这段code错在哪

楼主: Wardyal (Wardyal)   2024-08-07 10:11:37
:[READ_STATE]
for /F "tokens=* USEBACKQ" %%F IN (`cat state.txt`) DO (
set previous_state=%now_state%
set now_state=%%F
)
if %now_state%==%previous_state% (
echo [LOG] now_state is equal to previous_state, count - 1.
set /A retry_count=%retry_count%-1
) else if %now_state%==PRINT_STATE (
echo [LOG] stable printing mode, reset retry_count.
set retry_count=30
) else (
echo [LOG] now_state is not equal to previous_state, reset retry_count.
set retry_count=30
)
我一直编译不过
好像是 if %now_state%==%previous_state% 出问题
但是我又找不出来是哪里
我也没拼字错
有人看的出来吗
作者: ZIDENS (我不是正妹)   2024-08-07 10:13:00
错在你就不该写Code
作者: nh60211as   2024-08-07 10:18:00
工作自己做
作者: SecondRun (雨夜琴声)   2024-08-07 10:27:00
问gpt
作者: JerryChungYC (JerryChung)   2024-08-07 10:36:00
if '%now_state%'=='%previous_state%' 呢

Links booklink

Contact Us: admin [ a t ] ucptt.com