Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CHRTRAN() causes C5
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00215436
Message ID:
00215494
Vues:
30
>>I have recently traced a seemingly random occurence of the C5 error to a line of code containing the CHRTRAN() function. Searching the MS KB turned up an article that conforms this to be a bug in VFP 5x, especially on NT machines (I am using NT4, SP4). But the article states that the bug has been corrected in VFP6. Apparently not. Has anyone else gotten this in VFP6?
>
>Erik,
>
>What's the line of code? I can test on Win98, but not NT for you.

Well, I can give you the code, but since the error is random, I can't guarantee you'll be able to reproduce the it...

IF !EMPTY(CHRTRAN(tcDate, "0123456789", ""))
RETURN {}
ENDIF

Where tcDate is a string in the format that DTOS() returns. Ex: "19990505"
The line is checking to make sure that no characters other than digits made it into the string. I know I can work around the CHRTRAN line by looping through each character and checking ISDIGIT(), but I just wanted to know if MS knew this was happening to me.

This code runs in a fairly tight loop, so I estimate it crashes 1 in 250 iterations.

Check out MS KB Article Q182249 for details. Thanks for the offer.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform