Page.RequestFloat
Use this method to retrieve a value from a URL query string or form post variable and convert it to a floating-point value, based on the specified or default locale.
Optionally, the RequestFloat method also checks the converted number against the specified range.
Important
- This method is included for backwards compatibility with Site Server 3.0 Commerce Edition. See the AppFrameWork object, which provides similar functionality to that found in this method. Using the AppFrameWork methods is the preferred way of adding this type of functionality to your site, and will ensure better compatibility with future versions of Microsoft Commerce Server.
Definition
Function RequestFloat(bstrName As String,vtDefault As Variant,vtMin As Variant,vtMax As Variant,vtLocal As Variant) As Variant
Parameters
bstrName
A String that contains the name of the URL query string or form-post variable to retrieve.
vtDefault
A Variant that contains the value to return if the requested URL query string or form-post variable is not present or contains no value. If this parameter is not supplied, the method returns NULL. This parameter is optional.
vtMin
A Variant that contains the number that specifies the low end of the range of values against which to validate the converted value. The default value is NULL, indicating that this parameter is ignored. If the converted value is less than vtMin, the method returns NULL. This parameter is optional.
vtMax
A Variant that contains the number that specifies the high end of the range of values against which to validate the converted value. The default value is NULL, indicating that this parameter is ignored. If the converted value is greater than vtMax, the method returns NULL. This parameter is optional.
vtLocale
A Variant that contains the number that identifies the locale to use to convert the value. If this value is not specified, the RequestFloat method uses the value of the Locale property of the DataFunctions object. This parameter is optional.
Return Values
If this method completes successfully, it returns a Variant containing the floating-point value.
Error Values
This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.
Remarks
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.
Example
' oPage is a Commerce.Page object
' vFloat is a Variant
' This example assumes that the float value is entered using
' the following form:
<FORM METHOD ="POST" ACTION="PROCESS.ASP">
<INPUT TYPE="Text" NAME="Float">
<INPUT TYPE="SUBMIT" NAME="ACTION" VALUE="Send Info">
</FORM>
' If the user enters the number into the form and clicks the
' Send Info button, the value of this form field can be
' retrieved by the RequestFloat method as follows:
vFloat = oPage.RequestFloat("Float", 0, 0, 100, 1033)