Converts a string or byte array to a blob.
To |
Use |
---|---|
Convert a string to a blob |
|
Convert a string or byte array to a blob |
Converts a string to a blob datatype.
Blob ( text {, encoding} )
Argument |
Description |
---|---|
text |
The string you want to convert to a blob datatype |
encoding |
Character encoding of the resulting blob. Values are:
|
Blob. Returns the converted string in a blob with the requested encoding, if specified. If text is null, Blob returns null.
If the encoding argument is not provided, Blob converts a Unicode string to a Unicode blob. You must provide the encoding argument if the blob has a different encoding.
This example saves a text string as a Unicode blob:
Blob B
B = Blob("Any Text")
This example saves a text string as a blob with UTF-8 encoding:
Blob Blb
Blb = Blob("Any Text", EncodingUTF8!)
Converts a string or an array of bytes to a blob datatype.
Blob ( array[ ] )
Argument |
Description |
---|---|
stringorbytearray |
An Any variable that holds a string or an array of bytes you want to convert to a blob datatype |
Blob. Returns the converted string or byte array in a blob.
This example saves an array of bytes as a blob, then copies the contents of the blob to another byte array:
Blob lblb_1 Any a byte lbyte_array[], lbyte_array2[] // initialize array lbyte_array[] = {1,10,100,200,255} a = lbyte_array lblb_1 = Blob(a) lbyte_array2[] = GetByteArray(lblb_1)