>
>Look closer to my suggestion. You need to re-assign this filename variable again inside the loop. I think it's clearer than assignment and comparision as you're currently trying. At least for me it's simpler to understand and maintain.
Nadya,
This is the way assignment works in C/C# - you'll find a lot of those constructs (I wish Foxpro had them)
The assignment operators (=, /=, +=, *=, ...) have (except for the => operator) the lowest precedence
Also, the assignment operators (together with the unary operator and conditional operator) are right associative
have a look at this:
http://msdn.microsoft.com/en-us/library/aa691323(VS.71).aspxhence,
int i, j, k;
i = j = k = 1;
also
int x = 0;
int y = -~x; //1
int z = ~-x; // -1
so, the parentheses are needed around (filename = PopQueue()) to force the assignment to be executed first
while ( (filename = PopQueue()) != "" )
{
}
without parentheses, it would be executed like this (and filename would have to be a bool)
while ( filename = (PopQueue() != "") )
{
}
Once you start using it, you'll love it
Gregory