Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View Definition problem
Message
De
09/01/2013 13:37:16
 
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:
01561930
Vues:
49
>>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.
>
>
>Foxpro does grabs the first record of the returned resultset and uses the information to create the cursor, so the first record returned from your trim(string1) + ' ' + trim(string2) expression was C(9), so it was used to create the resulting cursor, this is either documented or very well known behaviour, cannot remember which :)

I know that's the case for returned values, but in the case I tried to explain about, the first record is not returned at all. At least "not by me" since the Where clause only matched the second record. I see your point, and I learned to always use cast whenever I want to retrieve data which involves any kind of "calculation".
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform