471,355 Members | 1,626 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,355 software developers and data experts.

Evaluate Expression in while


The code below does not work -- but is there a way to do this?

I want to both read a line and

string sline;

StreamReader m_streamReader = new StreamReader(fi);

while(sline=m_streamReader.ReadLine())
Debug.WriteLine(sline);
Jul 21 '05 #1
1 1497
Hello

The expression in a while or if statement must evaluate to a boolean
The following should work

while((sline = m_StreamReader.ReadLine()) != null)

Best regards,
Sherif

"Bagger Vance" <hi****@fuji.mount.> wrote in message
news:1108688616.b75be9ccfbb624e9ca938f5b6e0cd08d@t eranews...

The code below does not work -- but is there a way to do this?

I want to both read a line and

string sline;

StreamReader m_streamReader = new StreamReader(fi);

while(sline=m_streamReader.ReadLine())
Debug.WriteLine(sline);

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Charlie | last post: by
5 posts views Thread by Henry Jordon | last post: by
3 posts views Thread by Coco | last post: by
1 post views Thread by Bagger Vance | last post: by
5 posts views Thread by Csaba Gabor | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.