Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dividing by zero
Message
 
 
À
21/04/2010 11:39:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01461337
Message ID:
01461338
Vues:
114
This message has been marked as a message which has helped to the initial question of the thread.
To test:
CLEAR
LOCAL lnTest
lnTest = 0
lnTest = TEST1() / TEST2()  &&  <= returns a numeric value with value  ****** and does not fire an error
?lnTest
llBadData = VARTYPE(m.lnTest) = 'N' and STR(m.lnTest) = REPLICATE('*',10)
?llBadData
? 1/0 && Doesn't give error either
lnTest  = (1/0)

FUNCTION TEST1

  RETURN(1)

ENDFUNC

FUNCTION TEST2

  RETURN(0)

ENDFUNC
>Hi All,
>
>Interesting problem:
>
>
>CLEAR
>
>? TEST1() / TEST2()  &&  <= returns a numeric value with value  ****** and does not fire an error
>
>FUNCTION TEST1
>
>  RETURN(1)
>
>ENDFUNC
>
>FUNCTION TEST2
>
>  RETURN(0)
>
>ENDFUNC
>
>
>The calling of two user functions which results in a division by zero does not cause an error and instead returns a numeric value containing asterisks. Q. How to trap for this problem? How to test for result = *****?
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform