Supposing we have CMD batch script code like this:
CALL :SUB
REM DO SOMETHING WITH THE RESULT HERE (300)
EXIT
:SUB
EXIT /B 300
What variable or mechanism can be used to replace the REMarked like above to do one thing if the result of SUB was 300, and something else if not? I want to write in there something like this:
IF %RESULT% EQU 300 (
ECHO Hi
) ELSE (
ECHO Bye
)
Please correct me if I'm wrong but I think my mechanism (the conditional statement) here is fine, but what about the variable?