Created
September 11, 2023 08:38
-
-
Save gitSambhal/48134eff1f2410345bb08f5811d369dc to your computer and use it in GitHub Desktop.
Batch file with functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo PROGRAM_NAME:%~nx0 Start | |
echo. | |
================================ | |
SET debugMode=%1 | |
call :myFunc1 %debugMode% | |
call :myFunc2 para1 "para2 hello" | |
================================ | |
echo PROGRAM_NAME:%~nx0 End & pause>nul | |
EXIT /B | |
:: 👇 define the function under below | |
:myFunc1 <isDebug> | |
:: So that you can know the %1 means: isDebug. | |
if "%1" == "1" ( | |
echo debug mode | |
) | |
EXIT /B | |
:myFunc2 <para1> <para2> | |
:: output: para1 | |
echo %1 | |
:: output: "para2 hello" | |
echo %2 | |
EXIT /B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment