मेरे पास निम्न कार्य है जो इस तरह काम करता है:
आप एक स्ट्रिंग इनपुट करते हैं जो समान है: text text=text इस तरह: call :afterchar text text=text और इसके साथ आउटपुट text=text एक नया बनाने के बिना एक लाइन पर। जब यह वर्तमान में अच्छी तरह से काम कर रहा है, तो यह पहली बार चलाने पर "इस कमांड का सिंटैक्स गलत है" भी आउटपुट करता है। मुझे समझ नहीं आ रहा है कि इस त्रुटि को क्या ट्रिगर किया जा रहा है।
@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
<nul set /p "dummy=blah" आमतौर पर newline के बिना कुछ आउटपुट करने के लिए उपयोग किया जाता है। जांचें कि क्या आउटपुट के साथ कुछ भी नहीं है Ìf "%2%3" equ "" exit
For Loop Delims to extract textऔर सिर्फ एक सबरूटिन पोस्ट किया है जो फॉर-लूप से संबंधित नहीं है। यहाँ बहुत से टेलीपैथिक लोग हैं, लेकिन मुझे लगता है कि यहां तक कि वे आपके द्वारा प्रदान की गई कैच -22 जानकारी में आपकी मदद नहीं कर पाएंगे