c# to vb .net (2005) help
I want to convert this c# code to vb, please help.
while (
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
(scan < strend))
{
// Do nothing
}
Thanks
Javfarary
[486 byte] By [
Javfarary] at [2007-11-11 10:04:01]

# 3 Re: c# to vb .net (2005) help
Yes - it is possible. "alanfo" posted something close to an equivalent on another group.
But, as I mentioned elsewhere, there are many cases of "assignments within expressions" that cannot be generalized for automatic conversion. There are even some cases that have no possible VB equivalent (I'll try to dig one up for you today).
# 4 Re: c# to vb .net (2005) help
Here is a working equivalent - you should now see why automatic conversion of assignments within expressions is a bad idea - no one would want to see their code butchered like this by a converter:
Do
scan = scan + 1
match = match + 1
If window(scan) = window (match) Then
scan = scan + 1
match = match + 1
If window(scan) = window (match) Then
scan = scan + 1
match = match + 1
If window(scan) = window (match) Then
scan = scan + 1
match = match + 1
If window(scan) = window (match) Then
scan = scan + 1
match = match + 1
If window(scan) = window (match) Then
scan = scan + 1
match = match + 1
If window(scan) = window (match) Then
scan = scan + 1
match = match + 1
If window(scan) = window (match) Then
scan = scan + 1
match = match + 1
If window(scan) = window (match) Then
If scan < strend Then
' Do Nothing
Else
Exit Do
End If
Else
Exit Do
End If
Else
Exit Do
End If
Else
Exit Do
End If
Else
Exit Do
End If
Else
Exit Do
End If
Else
Exit Do
End If
Else
Exit Do
End If
Else
Exit Do
End If
Loop