Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange Index Error
Message
De
23/04/2013 12:32:17
 
 
À
22/04/2013 20:04:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01571265
Message ID:
01571671
Vues:
119
>>>>It sounds to me like the warning should be more along the lines of: If your
>>>>application will use different locales, or if you are changing SET CENTURY
>>>>or SET DATE settings manually, then avoid using DTOC(). Otherwise,
>>>>DTOC(x,1) will always work just fine.

>>>
>>>DTOC(x,1) will always work. It's equivalent to DTOS(). It's only DTOC() without the second parameter that's a bad idea.
>>
>>
>>Thanks, Tamar. That's another part I didn't get from this thread. I was under the impression that people were saying don't use DTOC() as a function at all, but always DTOS(). It wasn't making sense.
>
>I was referring to DTOC(x) w/o the extra parameter as that was the format that the original poster appears to have been using. As far as I know, the original poster wasn't complaining about errors in using the DTOS(x,1) format. As the output format of DTOC(x,1) is the same as DTOS() there should not be a problem in the case originally given. Although DTOS(x) and DTOC(x,1) return the same string, I generally prefer to use the DTOS(x) rather than DTOC(x,1) mainly because it's easier to spot potential problem areas by simply searching for instances of "DTOC(" -- using DTOS(x) would exclude that from the text search, whereas using "DTOC(x,1)" (which would be OK) to be included in the search results as well (and you're forced to check those lines for the problem) -- i.e. there will be fewer areas you'll have to check if I use DTOS(x) rather than DTOC(x,1).


Thanks, Naoto. :-)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform