My setup is the following:
I am reading an .ini
file with variables that look like that inside var=value
for /f "tokens=1* delims==" %%i in (file.ini) do (
set %%i=%%j
)
I am having a standard for loop checking if the variables have values (been set)
for %%p in (var1 var2 var3..) do (
if not defined %%p (
call :error "%%p has not been set"
goto exit
) else (
echo %%p=!%%p!
)
)
What could I add to it to check for trailing whitespace, as if the user hit space after he would set a value it will mess up with the flow of things as the variables represent paths and what not.