Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select text based on a number
Message
From
02/10/2004 06:33:59
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00948140
Message ID:
00948182
Views:
21
Hi,

If it's just the simple case then maybe something simple like :
STREXTRACT(":ONE:TWO:THREE:FOUR:FIVE:SIX:SEVEN:EIGHT:NINE:TEN",":",":",m.NumberVariable)
HTH,Viv
>>
Is there a command that will allow you to select text based on a number?
Say you have a number value 1, 2, or 3 and you want to return the text "This is one" if the number value is 1, and "This is two" if the number value is 2, etc. Is there a command that can do this type of thing, I would guess it would look something like this...
m.StringVariable = ???(m.NumberVariable,'One','Two','Three')
so m.StringVariable = 'One' if the m.NumberVariable = 1
I can do this with multiple IIF(), but if there is a easier way I'd sure like to know.
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform