Search found 4 matches

by techtony
01 Apr 2019 20:57
Forum: DOS Batch Forum
Topic: A bit embarassed
Replies: 1
Views: 2563

A bit embarassed

That I am here posting to DosTips. But I'm doing it, so there must be a reason, right? What gives me pause is that this place is still here. I'm all about "getting it done" and moving on, but wtf? Is it done? The creativity here is astounding. I think I know where to go with that, but I'm not good a...
by techtony
25 Apr 2018 06:02
Forum: DOS Batch Forum
Topic: 'for' statement in macro will not accept 'tokens' argument from another 'for' statement. Why?
Replies: 6
Views: 6240

Re: 'for' statement in macro will not accept 'tokens' argument from another 'for' statement. Why?

penpen wrote: "Another option is to use string replacement within environment variables." That looked promising, but as the element number is likely to come from a variable and not a literal, that technique doesn't work. (That detail was not in the OP, because I was just pondering the situation, but...
by techtony
23 Apr 2018 07:45
Forum: DOS Batch Forum
Topic: 'for' statement in macro will not accept 'tokens' argument from another 'for' statement. Why?
Replies: 6
Views: 6240

Re: 'for' statement in macro will not accept 'tokens' argument from another 'for' statement. Why?

The macroization attempt, though, does introduce the problem. The macroization was, of course, done to avoid the overhead of a function call (which would have been a nice little snippet if it would have worked!). Thanks for your explanation.
by techtony
23 Apr 2018 06:49
Forum: DOS Batch Forum
Topic: 'for' statement in macro will not accept 'tokens' argument from another 'for' statement. Why?
Replies: 6
Views: 6240

'for' statement in macro will not accept 'tokens' argument from another 'for' statement. Why?

set get_element=^ for /l %%N in (1 1 2) do if %%N equ 2 (^ for /f "tokens=1-3 delims= " %%A in ("^!args^!") do (^ for /f "tokens=%%B delims=," %%X in (^!%%A^!) do (^ set "%%C=%%X"^ )^ )^ ) else set args= set lst="one,two,three" %get_element% lst 2 el echo,el: [%el%] Output: %B delims=," was unexpec...