Mein Batch-Skript funktionierte gut, bis ich versuchte, einige lange if-Anweisungen hinzuzufügen. Ich bin neu dazu und möchte, wenn jemand überprüfen könnte, was falsch ist. Ich versuche, einen Preiskalkulator zu erstellen, basierend auf welchem Rang Sie sind.Stapel-Skript kann nicht funktionieren Wenn Anweisungen funktionieren
Heres der Abschnitt, der nicht funktioniert.
if "%drating%" < "1500" (set /a price=%price%+3)
else if "%drating%" < "2000" (@set /a price=%price%+5)
else if "%drating%" < "2500" (@set /a price=%price%+6)
else if "%drating%" < "2700" (@set /a price=%price%+8)
else if "%drating%" < "3000" (@set /a price=%price%+10)
else if "%drating%" < "3300" (@set /a price=%price%+12)
else if "%drating%" < "3500" (@set /a price=%price%+14)
else if "%drating%" < "3800" (@set /a price=%price%+20)
else if "%drating%" < "3900" (@set /a price=%price%+30)
else if "%drating%" < "4000" (@set /a price=%price%+40)
else if "%drating%" < "4100" (@set /a price=%price%+50)
else (
echo There is no available price for %drating%.
echo Press any key to exit.
set /p exitkey=
)
heres, was ich nach magoo
tatif "%drating%" LSS "1500" (set /a price=%price%+3
) else (if "%drating%" LSS "2000" (set /a price=%price%+5
) else (if "%drating%" LSS "2500" (set /a price=%price%+6
) else (if "%drating%" LSS "2700" (set /a price=%price%+8
) else (if "%drating%" LSS "3000" (set /a price=%price%+10
) else (if "%drating%" LSS "3300" (set /a price=%price%+12
) else (if "%drating%" LSS "3500" (set /a price=%price%+14
) else (if "%drating%" LSS "3800" (set /a price=%price%+20
) else (if "%drating%" LSS "3900" (set /a price=%price%+30
) else (if "%drating%" LSS "4000" (set /a price=%price%+40
) else (if "%drating%" LSS "4100" (set /a price=%price%+50
) else (echo There is no available price for %drating%.
echo Press any key to exit.
set /p exitkey=
exit
)
Hilft, wenn Sie die Hilfe für den Befehl lesen, den Sie verwenden möchten. Öffnen Sie eine Eingabeaufforderung und geben Sie ein: 'if /?' – Squashman
Ich habe es gelesen, keine Ahnung, was ich falsch gemacht habe, obwohl – Bruce219
Wirklich !!!! Sie sehen das weniger als Symbol in der Hilfedatei. – Squashman