Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
STRTRAN() & Null as Replacement
Message
De
08/07/2010 21:03:30
June Kendrick
Kendrick Associates, Inc.
New York, États-Unis
 
 
À
08/07/2010 13:06:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01471525
Message ID:
01471934
Vues:
40
>>Is the following a bug in STRTRAN()? It happens in VFP 7 & 9.
>>
>>? ISNULL(STRTRAN('XXX', 'YYY', NULL)) && prints .T.
>>
>>'YYY' doesn't appear in 'XXX', so why is it substituting NULL in the first place? If the expression sought doesn't exist in the expression to be searched, I would expect to have the expression to be searched returned as is, regardless of the replacement expression.
>
>it is not a bug.
>
>When a parameter is null and the function is deterministic,
>a parameter that can null the result, makes the result always null.

I can understand the reasoning behind that, even though it doesn't meet my expectations. Perhaps my expectations have just been trained wrong <g>.

Thanks to all for their responses.

>
>for this ? expect NULL or B ?
>
>? STRTRAN(NULL,NULL,"B")
>
>
>next is a bug
>
>
>? DTOC(DATE(),1)
>? DTOC(DATE(),NULL) && expect null
>
>
>bug origin ?
>because the code checks if there is one parameter, not the value of the parameter,
>Eventualer any future modification of the parameter will be a problem.
>
>
>? DTOC(DATE(),"")
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform