Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forcing type
Message
De
16/09/2003 17:14:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
16/09/2003 16:37:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00829623
Message ID:
00829648
Vues:
28
>Hi Sergey:
>
>I didn't know that TRANSFORM could be used quite like that. Thanks!

Yes, but depending on your needs, you may want to write a UDF to change some defaults. For instance, you may not always want to display .T. as ".T.", and .F. as ".F.".

For a start, let's assume you want to show .T. as "Yes", .F. as "No", and use the transform() standards for all other purposes. You also want to accomodate null values:
function ConvertToChar(txValue)
do case
case isnull(txValue)
  return "???"
case type("txValue") = "L"
  return iif(txValue, "Yes", "No")
otherwise
  return transform(txValue)
endcase
If you later see that you need additional exceptions to the standard format, add your CASEs into this function.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform