Welcome!

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

SignUp Now!

Command grouping in for... loops

Jun
70
2
In a for ... in ... do (...) loop with command grouping, when multiple commands are wrapped in the parentheses grouping, what are the limits to what or how much can be placed in the parentheses?

Is is strictly a character count or what? I have had a batch file that seemed to work fine when I had, say, 20 lines in the parenthetical grouping, but now that I have added additional lines, the command fails. The help message just says improper syntax. So I'm wondering whether I'm trying to put too much stuff in the (parentheses).

What are the limits, restrictions, etc., to command grouping?

Eric
 
| What are the limits, restrictions, etc., to command grouping?

All the limitations on sizes are in HELP topic "limitations.htm". RTFM.
--
HTH, Steve
 
In a for ... in ... do (...) loop with command grouping, when multiple commands are wrapped in the parentheses grouping, what are the limits to what or how much can be placed in the parentheses?

Is is strictly a character count or what? I have had a batch file that seemed to work fine when I had, say, 20 lines in the parenthetical grouping, but now that I have added additional lines, the command fails. The help message just says improper syntax. So I'm wondering whether I'm trying to put too much stuff in the (parentheses).

What are the limits, restrictions, etc., to command grouping?

A command group is essentially one long command line, even if you split it across several physical lines. Twenty lines in one logical line seems a little excessive; I'd recommend rewriting it as a DO loop.
 
Aside from the actual limits that Steve pointed out, you would be better
off re-writing your FOR loops using DO loops in TCC. This make debugging
substantially easier because it allows you to single step through the
statements within the loop. Plus it eliminates the limit on compound
statement length and instead each line has its own limit.

-Scott

epement <> wrote on 04/26/2010 10:13:17 AM:


> In a for ... in ... do (...) loop with command grouping, when
> multiple commands are wrapped in the parentheses grouping, what are
> the limits to what or how much can be placed in the parentheses?
>
> Is is strictly a character count or what? I have had a batch file
> that seemed to work find when I had, say, 20 lines in the
> parenthetical grouping, but now that I have added additional lines,
> the command fails. The help message just says improper syntax. So
> I'm wondering whether I'm trying to put too much stuff in the
(parentheses).

>
> What are the limits, restrictions, etc., to command grouping?
>
> Eric
>
>
>
>
 
Aside from the actual limits that Steve pointed out, you would be better
off re-writing your FOR loops using DO loops in TCC. This make debugging
substantially easier because it allows you to single step through the
statements within the loop. Plus it eliminates the limit on compound
statement length and instead each line has its own limit.

I believe this is probably the solution to my question. Thanks, Scott (and Charles), for suggesting the DO loop as a better way handle this.

Eric
 

Similar threads

Back
Top