Welcome!

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

SignUp Now!

Inserting string into a variable.

Oct
73
1
I'm trying to insert "new-" at the beginning of a filename that was read for the command line into a variable. Why doesn't this work (and no insults please :))
set filmname=%$
set newfilename=%@insert[0,new-,%filename]
 
It seems to work here. Is there anything peculiar about the filename? You have used "filmname" and "filename" ... ?

Code:
v:\> type prefix.btm
set name=%$
set newname=%@insert[0,new-,%name]
echo %newname

v:\> prefix.btm foo
new-foo
 
Oh, thanks. I just realized there was a spelling error in my code. My 80-year-old eyes didn't notice it. Thanks.
 
If all you are doing is pre-pending why do you need @insert?
can't you do set newname=new-%filename
 
Back
Top
[FOX] Ultimate Translator
Translate