Search found 4 matches

by chuntuk
08 Aug 2012 09:01
Forum: DOS Batch Forum
Topic: How do I use the :StartsWith function?
Replies: 9
Views: 6796

Re: How do I use the :StartsWith function?

In 20 years of working as a developer, this is the first time I've had to write a DOS batch file (other than the most trivial tweaking of AUTOEXEC.BAT back in the day). It may be many more years before I have to tangle with one again. Whoever has to maintain my script in the future will probably be ...
by chuntuk
08 Aug 2012 03:14
Forum: DOS Batch Forum
Topic: How do I use the :StartsWith function?
Replies: 9
Views: 6796

Re: How do I use the :StartsWith function?

@Squashman The "last bit of code that ED gave me" calls the function like this: call :StartsWith "hello world !" "hello" &&echo.it does ||echo.it doesn't call :StartsWith "hello world !" "world" &&echo.it does ||echo.it doesn't Hence ...
by chuntuk
07 Aug 2012 09:04
Forum: DOS Batch Forum
Topic: How do I use the :StartsWith function?
Replies: 9
Views: 6796

Re: How do I use the :StartsWith function?

How would I do something along the lines of

IF {startswith expression here} (
echo yes it does
) else (
echo no it doesn't
)
by chuntuk
07 Aug 2012 07:09
Forum: DOS Batch Forum
Topic: How do I use the :StartsWith function?
Replies: 9
Views: 6796

How do I use the :StartsWith function?

I'd like to use the :StartsWith function included on this site at m but it isn't obvious to me how I get hold of the results of the function. It appears that if the passed string doesn't start with the passed characters, it'll do this: set=2>NUL Which isn't like the way any of the other functions pa...