CodeDom in .NET 2.0, WHILE loops

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

In version 1.1 of the framework, there is no method for generating a WHILE
loop using the CodeDom namespace. The CodeIterationStatement can be used to
create FOR loops, but not WHILE loops. I'm looking at the version 2.0
documentation online http://msdn2.microsoft.com/library/za6cc751.aspx) and
not seeing any improvement here.

Is there a class available in 2.0 for creating While loops in the CodeDom?

Thanks in advance.

Mark
 
Mark said:
In version 1.1 of the framework, there is no method for generating a WHILE
loop using the CodeDom namespace. The CodeIterationStatement can be used
to
create FOR loops, but not WHILE loops. I'm looking at the version 2.0
documentation online http://msdn2.microsoft.com/library/za6cc751.aspx) and
not seeing any improvement here.

Is there a class available in 2.0 for creating While loops in the CodeDom?

I'm not sure why you would care in generated code when FOR is the more
general construct.

while (x) == for (;x;)

David
 
Hello
I'm not sure why you would care in generated code when FOR is the more
general construct.
I would care only to make the generated code look better.

Best regards,
Sherif
 
Sherif said it pretty well. I'd summarize it as "butt ugly" and confusing
for those developers that will be CONSUMING the code that I'm generating.
So .... are there any WHILE loop generators in version 2.0 or before?

Thanks again.

Mark
 
Mark said:
Sherif said it pretty well. I'd summarize it as "butt ugly" and confusing
for those developers that will be CONSUMING the code that I'm generating.
So .... are there any WHILE loop generators in version 2.0 or before?

There's no for loop statement either; there's a general iteration statement.
Nothing stops the C# implementation of CodeIterationStatement from
generating while loops where appropriate, i.e. where the initialization and
iteration properties are null. That's the enhancement I'd ask for. (If I
used CodeDom for C# generation, which I don't. The lack of switch statement
support was the killer.)
 
Back
Top