Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparing to NULL
Message
 
 
À
23/07/2007 19:13:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01243011
Message ID:
01243016
Vues:
26
>>>>What is a recommended method of comparing to NULL? I need to determine if a value of a field has changed. But when it changes to NULL value (and it is allow for this field) the comparison to NULL is NULL. Any suggestions on how to deal with this?
>>>>
>>>>Thank you.
>>>
>>>IF ISNULL(YourField)
>>
>>Yes, I know this function. What I was asking is how to compare current value with old value. This is the segment of code I was using:
>>
>>
>>!(EVALUATE(FIELD(i)) == OLDVAL(FIELD(i), "V_MYTABLE"))
>>
>>
>>What I ended up doing is checking if value before change was NULL and after change is NULL and use the result. As the following:
>>
>>
>>IF (!ISNULL(EVALUATE(FIELD(i))) AND ISNULL(OLDVAL(FIELD
>>(i), "V_V_MYTABLE"))) OR ;
>>(ISNULL(EVALUATE(FIELD(i))) AND !ISNULL(OLDVAL(FIELD
>>(i), "V_V_MYTABLE"))) OR ;
>>!(EVALUATE(FIELD(i)) == OLDVAL(FIELD(i), "V_V_MYTABLE"))
>>
>>
>>Thank you very much for your help.
>
>
>I'm not really sure what it is you're trying to check here. Are you looking for a change in value? Or are you looking to see if the OLDVAL() is different than the current field value?

I am looking if the current value is different from the old value.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform