B
B. Chernick
I have a little problem I'm not clear on. I program mostly in VB, I am
somewhat familiar with C#, and I've been told to translate a program. I was
under the general impression that since C# and VB are both Dot Net languages,
it was more or less possible to directly translate everything, aside from a
few individual language quirks.
In the original C# I have the following:
foreach (AccountInfo item in Accounts)
{
if (item.LastChangedBy != null)
{
... do some stuff here.
}
}
where LastChangedBy is an integer property of the object AccountInfo
My freeware translator has rendered this in VB as:
For Each item As AccountInfo In Accounts
If item.LastChangedBy IsNot Nothing Then
VS does not like this and gives an error: 'IsNot' requires operands that
have reference types, but this operand has the value type 'Integer'.
How would you translate this?
somewhat familiar with C#, and I've been told to translate a program. I was
under the general impression that since C# and VB are both Dot Net languages,
it was more or less possible to directly translate everything, aside from a
few individual language quirks.
In the original C# I have the following:
foreach (AccountInfo item in Accounts)
{
if (item.LastChangedBy != null)
{
... do some stuff here.
}
}
where LastChangedBy is an integer property of the object AccountInfo
My freeware translator has rendered this in VB as:
For Each item As AccountInfo In Accounts
If item.LastChangedBy IsNot Nothing Then
VS does not like this and gives an error: 'IsNot' requires operands that
have reference types, but this operand has the value type 'Integer'.
How would you translate this?