Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Input Mask Question
Message
From
19/01/1999 13:57:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00177692
Message ID:
00177699
Views:
39
Hiya Mark ----

So you don't know if the mask is going to be A-999 or A999? But you do know what the mask is via a memvar at runtime? How about:

cMask="A-999" (or "A999")
vValue="Z123"

Field expr in report:

IIF(SUBSTR(cMask,2,1)="-",LEFT(vValue,1)+"-"+RIGHT(vValue,3),vValue)

Would this work?


>I'm struggling a bit with implementing input masks. The input mask for and inventory bin location is a parameter that the user can set on the parameter screen. I am not storing the mask with the data (format = "!R" on the bin location text box class).
>
>Now I am ready to make my reports. I expected to be able to use TRANSFORM() to apply the mask to the data, but it doesn't work correctly with character data.
>
>a = "A-999"
>b = "Z123"
>?transform(b,a) ---> "Z-23"
>
>It appears that character "spacers" in the mask (for example, a hyphen or parenthesis) only work properly when the underlying data is numeric! For example,
>
>a = "9-999"
>b = 1234
>?transform(b,a) --> "1-234"
>
>Is there any other way to put the mask on output data other than writing a UDF that scans the mask character by character and using that in my SQL statements?
>
>I would prefer not to store the mask with the data because if you have hyphens in the mask, EMPTY(txtBox.Value) returns .F. when the control is "empty" (as the value contains the hypens). TIA.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform