shaul_ahuva
Member
Ive been searching for a way to do the following in VB.NET:
Does anyone know if there are equivalents in VB.NET? I dont know very much about the costs of the various operations in MSIL, but in the above scenarios the number of operations can be significantly more in VB.NET.
C#:
for (Control c = someControl; c.Parent != null; c = c.Parent)
{
/*
VB For loop syntax does not allow this (as far as I know). A Do While Loop could be used, but Id rather have the variable go out of scope after the loop is done...
*/
}
//--------------------
Control c = null;
string text = (c != null) ? c.Text : "";
/*
In VB.NET IIf would break if c is null since IIf is just a function call, and the result of c.Text is just a parameter...
*/
Does anyone know if there are equivalents in VB.NET? I dont know very much about the costs of the various operations in MSIL, but in the above scenarios the number of operations can be significantly more in VB.NET.