Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Forcing type
Message
From
16/09/2003 17:14:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
16/09/2003 16:37:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00829623
Message ID:
00829648
Views:
29
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform