Information générale
Catégorie:
Code, syntaxe and commandes
>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
BOb;
The reason I gave up VB.NET and have stuck with C# is that VB.NET let me do some things that "sometimes worked" and also let me do things I should not have been allowed to do! :)
Tom
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement