[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