Double
PowerScript function
Description
Converts a string to a double or obtains a double value that is
stored in a blob.
Syntax
|
1 |
Double ( stringorblob ) |
|
Argument |
Description |
|---|---|
|
stringorblob |
A string whose value you want returned as a double or a |
Return value
Double.
Returns the contents of stringorblob as a double. If stringorblob is
not a valid PowerScript number or if it contains a non-numeric datatype,
Double returns 0. If stringorblob is null, Double returns null.
Usage
To distinguish between a string whose value is the number 0 and a
string whose value is not a number, use the IsNumber function before
calling the Double function.
Examples
This statement returns 24.372 as a double:
|
1 |
Double("24.372") |
This statement returns the contents of the SingleLineEdit
sle_distance as a double:
|
1 |
Double(sle_distance.Text) |
After assigning blob data from the database to lb_blob, this example
obtains the double value stored at position 20 in the blob (the length you
specify for BlobMid must be at least as long as the value but can be
longer):
|
1 2 |
double lb_num lb_num = Double(BlobMid(lb_blob, 20, 40)) |
For an example of assigning and extracting values from a blob, see
Real.
See also