I have the following function that works like this:
You input a string that resembles: text text=text
like this: call :afterchar text text=text
and it outputs with text=text
on a line without creating a new one. While it is currently working well, it also outputs "The Syntax of this command is incorrect" when I run it the first time. I don't understand what is triggering this error.
@echo off
:read
shift
if "%1"=="" set err=2 & goto help
if "%2"=="where" goto where
set DB=%1.db
if not exist "C:\users\Public\Temp\%DB%" call :c 0c "Database not found: %2" & exit /b 1
setlocal EnableDelayedExpansion
set numline=0
for /f "tokens=1,2,3,4,5,6,7,8,9,10* delims=# skip=1" %%A in (C:\users\Public\Temp\%DB%) do (
set /a numline+=1
if not "%%A"=="" call :afterchar %%A
if not "%%B"=="" call :afterchar %%B
if not "%%C"=="" call :afterchar %%C
if not "%%D"=="" call :afterchar %%D
if not "%%E"=="" call :afterchar %%E
if not "%%F"=="" call :afterchar %%F
if not "%%G"=="" call :afterchar %%G
if not "%%H"=="" call :afterchar %%H
if not "%%I"=="" call :afterchar %%I
if not "%%J"=="" call :afterchar %%J
echo.
)
goto skpp
:afterchar
echo|set /p=" %2=%3 "
exit /b
:skpp
if %errorlevel%==0 call :C 0a "Success."
exit /b
For Loop Delims to extract text
and posted just a subroutine that isn't related to For-Loop. Here a lot of telepathic people, but I think even they wouldn't be able to help you with catch-22 information you provided<nul set /p "dummy=blah"
is usually used to output something without newline. Check if there is nothing to output withÌf "%2%3" equ "" exit