Syntax 2: For converting strings and blobs
Description
Converts a string whose value is a number into a long or obtains a
long value stored in a blob.
Syntax
|
1 |
Long ( stringorblob ) |
|
Argument |
Description |
|---|---|
|
stringorblob |
The string you want returned as a long or a blob in |
Return value
Long.
Returns the value of stringorblob as a long if it succeeds and 0
if stringorblob is not a valid PowerScript number or if it is an
incompatible datatype. If stringorblob is null, Long 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 Long function.
Examples
This statement returns 2167899876 as a long:
|
1 |
Long("2167899876") |
After assigning blob data from the database to lb_blob, the
following example obtains the long value stored at position 20 in the
blob:
|
1 2 |
long lb_num lb_num = Long(BlobMid(lb_blob, 20, 4)) |
For an example of assigning and extracting values from a blob, see
Real.
See also
Long method for DataWindows in the section called “Long” in DataWindow Reference.