Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB.Net if bug???
Message
De
23/02/2005 14:46:15
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
VB.Net if bug???
Divers
Thread ID:
00989793
Message ID:
00989793
Vues:
53
Ok,

I ran into this once, and I thought I was nuts, or something so I dismissed it. Now, I have seen it again.

Here is what is happening. I have a DataRow from a Typed Dataset. For each field it gives you the IsFieldNameNull function. So, in VB .Net I would code something like:

if drJournal.IsAutoRevDateNull Then
' Insert a new Journal Entry
else
' Update an existing Journal Entry
end if

So... even though IsAutoRevDateNull is true the above runs the else code. Now, I found three mods that work:

if drJournal.IsAutoRevDateNull Then
' Insert a new Journal Entry
else
' Update an existing Journal Entry
end if

or

if (drJournal.IsAutoRevDateNull) Then
' Insert a new Journal Entry
else
' Update an existing Journal Entry
end if

or

if drJournal.IsAutoRevDateNull() Then
' Insert a new Journal Entry
else
' Update an existing Journal Entry
end if


***********

So, it seems that I need something to force the function to eval. However, it seems to me if VB is not going to require the perens on a function that it should still be evaled to get the boolean value.

Any comments. Is this a bug, or just a VB thing that bothers me cause VFP and C# work fine. Of course, C# requires the perens.

BOb
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform