Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View Definition problem
Message
De
09/01/2013 12:54:59
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01561890
Message ID:
01561918
Vues:
48
>>Gregory
>>
>>Thank you for the explanation. I would have been many hours arriving at that conclusion! If at all. The curious thing is that it has been working fine for several months. Maybe by chance the resulting figure format has agreed with the view so far and this has come about on one particular record.
>>
>>Anyway, sorted. And thanks again for your input. Much appreciated.
>>
>>Barry.
>
>Make it a rule to always use CAST for calculated fields. Don't rely on VFP (or any other backend) to make correct assumptions about the final field type.

This applies to any kind of "calculated" fields, also text fields. Today I selected from a table with only two records, using a UDF which created a new string, like newstring = trim(string1) + ' ' + trim(string2). The record I searched for using the appropriate Where filter, came out as c(9) which would have been correct for the first record in the table. However, the record I searched was the second one, and for this record I got truncated data. I don't know if C(9) was chosen by VFP because of the data in the first record, or if it is some default field length. But the result puzzled me, I was not prepared for this behavior with such a small table.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform