Data Access Worldwide Knowledge Base

Article ID 2205
Article Title HOWTO: Get the DD values that are used for range validation
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2205
KBase Category VDF11
Date Created 01/05/2006
Last Edit Date 01/22/2006


Article Text
QUESTION:
In my DD class (via Database Builder) I can see that the range validation is specified via Set Field_Value_Range. The VDF documentation specifies that it is a write-only property. I would like to be able to query the values at a certain moment in time. How do I do this?

ANSWER:
There is - as the help specifies - no command/function to retrieve the values. The DD class, however, retrieves the values to validate your input. With that knowledge it was simple to build the following function:

Function Field_Value_Range Integer iField Boolean bMinimum Returns String
    Integer iType iItem
    String sValue

    Get Field_Validation_Type iField To iType
    If (iType = FA_VALIDATION_TYPE_RANGE) Begin
        If (bMiniMum) Begin
            Move ((iField * FA_COUNT) + FA_MIN_VALUE) To iItem
            Get Value Of Field_Attributes Item iItem To sValue
        End
        Else Begin
            Move ((iField * FA_COUNT) + FA_MAX_VALUE) To iItem
            Get Value Of Field_Attributes Item iItem To sValue
        End
    End

    Function_Return sValue
End_Function // Field_Value_Range

You can use this - after adding to the DDO or your DataDictionary subclass by coding:

    Get Field_Value_Range Of oInvt_DD Field Invt.Unit_Price True To sMinValue
    Get Field_Value_Range Of oInvt_DD Field Invt.Unit_Price False To sMaxValue

The Invt table - in the order11_1 sample - has a field called Unit_Price and the range is specified as 0 999999.99. The first call returns a 0 and the second call returns 999999.99






Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.