Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Fixed @regexsub[] broken

Jun
223
0
Consider the following snippet (copy to a file, say x.btm, and execute it as x):

setlocal
set make=z:\bin\gnu\bin\make.exe
gosub recompile gvimext/gvimext.dll
quit
endlocal

:recompile [prog params]
echo cd %@regexsub[1,(.*)/(.*),%prog%]
echo %make% -q -f make_ming.mak %@regexsub[2,(.*)/(.*),%prog%] %params%
return


In 16 the (correct) output is:

cd gvimext
z:\bin\gnu\bin\make.exe -q -f make_ming.mak gvimext.dll


In 17 I get:

cd
z:\bin\gnu\bin\make.exe -q -f make_ming.mak
 
It works rather randomly here. I've also seen it produce a good first line together with a bad second line.
Code:
v:\> type regextest.btm
setlocal
set make=z:\bin\gnu\bin\make.exe
gosub recompile gvimext/gvimext.dll
endlocal
quit

:recompile [prog params]
echo cd %@regexsub[1,(.*)/(.*),%prog]
echo %make -q -f make_ming.mak %@regexsub[2,(.*)/(.*),%prog] %params
return

cd gvimext
z:\bin\gnu\bin\make.exe -q -f make_ming.mak gvimext.dll

v:\> regextest.btm
cd gvimext
z:\bin\gnu\bin\make.exe -q -f make_ming.mak gvimext.dll

v:\> regextest.btm
cd
z:\bin\gnu\bin\make.exe -q -f make_ming.mak

v:\> regextest.btm
cd gvimext
z:\bin\gnu\bin\make.exe -q -f make_ming.mak gvimext.dll

v:\> regextest.btm
cd
z:\bin\gnu\bin\make.exe -q -f make_ming.mak
 
Back
Top
[FOX] Ultimate Translator
Translate