GetByte

Description

Extracts data of type Byte from a blob variable.

Syntax

GetByte ( blobvariable, n, b )

Argument

Description

blobvariable

A variable of the Blob datatype from which you want to extract a value of the Byte datatype

n

Tthe number of the position in blobvariable at which you want to retrieve a value of the Byte datatype

b

Variable of the Byte datatype in which you want to store the returned data of type Byte


Return value

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:

Int li_rtn
Byte lb_byte
Blob myBlob
myBlob = Blob (sle_1.text, EncodingUTF8!)
li_rtn = GetByte(myBlob, 3, lb_byte)
messagebox("getbyte", string(lb_byte))

See also

Byte

SetByte