Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional Formatting of Field Values
Message
De
20/08/2008 13:38:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
20/08/2008 09:55:35
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01340331
Message ID:
01340432
Vues:
12
>Ok, but the UDF would still be a series of CASE statements to return the correctly formatted field value, right?

Probably. One level of DO CASE for each type of field, a second level for each format defined for that type of field.

Unless you decide to use a data-driven approach: Instead of the CASEs, put the different options into a table, and your function just looks it up. That may save you re-compiling when you add a CASE. Actually, since you have some complicated formatting, in this case you probably would have to store the entire expression in a memo field, e.g. (for a date), something like this: trans(year(txValue)) + "-" + padl(month(txValue), 2, "0") + "-" + padl(day(txValue), 2, "0"). I did something similar for data validation, and it works quite well.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform