Daniel,
The closest you will come to a Continue in VB.NET is to use the Goto
keyword.
Something like:
szLine = myReader.ReadLine()
Do Until szLine Is Nothing
If szLine.Chars(0) = "-"c Then
szLine = myReader.ReadLine()
GoTo continue
End If
szLine = myReader.ReadLine()
If szLine is Nothing Then Exit Do
'
' rest of the loop code
'
continue:
Loop
Personally I would put a single ReadLine after the Continue, avoiding the
third ReadLine. Also I would consider having the 'rest of the loop code' in
the Else block of the If comment block. Or change the If comment to If Not
comment rest of loop code.
Hope this helps
Jay
"Daniel Bass" <da********@NOSPAMpostmaster.co.uk> wrote in message
news:uu****************@TK2MSFTNGP12.phx.gbl...
is there an equivalent key word for C++'s "continue" in VB (.net) in this
context?
CString szLine;
szLine = myReader.ReadLine();
while ( !szLine.IsEmpty() )
{
if ( szLine(0) == '-' )
{
szLine = myReader.ReadLine();
continue; // <-- HERE, so if szLine starts with "-" then
// the rest of this loop is not executed this
time round...
}
szLine = myReader.ReadLine();
//
// rest of the loop code
//
}
thanks!
Daniel.