Release Method

DynamicInputMask

This is the newest addition to the Dynamic property group for columns. Like the others, it lets you specify an expression that's evaluated at runtime for each row in the grid. In this case, the result of the expression provides an InputMask for the column.

Usage

colColumn.DynamicInputMask = cInputMaskExpression cInputMaskExpression = colColumn.DynamicInputMask
This property finally lets us do something we've been wanting to do since FoxPro 2.x—use an appropriate input mask (PICTURE clause) for the expected input in different rows. You provide an expression that results in a valid InputMask and VFP does the rest. Most often, you'll use either IIF() or a custom function to figure out the right mask. One thing that often trips us up: Make sure that when setting the value, you specify DynamicInputMask as a string, with beginning and ending string delimiters. Otherwise, you can spend quite a while chasing down "Expression is invalid" messages at runtime.

Example

* Specify an InputMask for PostalCode based on the Country. * This is the short version. This.DynamicInputMask = "IIF(UPPER(Country) = 'USA'," + ;    "'99999-9999',IIF(UPPER(Country)='CANADA'," + ;    "'A9A 9A9','XXXXXXXXXX'))"

See Also

DynamicBackColor, DynamicForeColor, Format, InputMask


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net