GetByte PowerScript function
Description
Extracts data of type Byte from a blob
variable.
Syntax
|
1 |
<span>GetByte</span> ( <span>blobvariable</span>, <span>n</span>, <span>b</span> ) |
|
Argument |
Description |
|---|---|
|
blobvariable |
A variable of the Blob datatype |
|
n |
Tthe number of the position in blobvariable at |
|
b |
Variable of the Byte datatype |
Return Values
Integer. Returns 1 if it succeeds or
-1 if n exceeds the scope of blobvariable;
it returns null if the value of any of its arguments
is null.
Usage
If you want to get the value of the initial character in a
blob, you can use the Byte function without using
an argument defining the position of the character.
Examples
This example converts the text in a SingleLineEdit
to a blob before obtaining the byte value of the character at the
third position:
|
1 |
Int li_rtn |
|
1 |
Byte lb_byte |
|
1 |
Blob myBlob |
|
1 |
myBlob = Blob (sle_1.text, EncodingUTF8!) |
|
1 |
li_rtn = <span>GetByte</span>(myBlob, 3, lb_byte) |
|
1 |
messagebox("getbyte", string(lb_byte)) |