Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Syntax 2: For blobs – PB Docs 2021 – PowerBuilder Library

Syntax 2: For blobs – PB Docs 2021

Syntax 2: For blobs

Description

Converts data in a blob to a string value. If the blob’s value is
not text data, String attempts to interpret the data as
characters.

Syntax

Argument

Description

blob

The blob whose value you want returned as a string. Blob
can also be an Any variable containing a blob.

encoding

Character encoding of the blob you want converted.
Values are:

  • EncodingANSI!

  • EncodingUTF8!

  • EncodingUTF16LE! (default)

  • EncodingUTF16BE!

Return value

String.

Returns the value of blob as a string if it succeeds and the empty
string (“”) if it fails. It the blob does not contain string data,
String interprets the data as characters, if possible, and returns a
string. If blob is null, String returns null.

Usage

If the encoding argument is not provided, String converts a
Unicode blob to a Unicode string. You must provide the encoding argument
if the blob has a different encoding.

If the blob has a byte-order mark (BOM), String filters it out
automatically. For example, suppose the blob’s hexadecimal display is:
FF FE 54 00 68 00 69 00 73 00. The BOM is FF FE, which indicates that
the blob has UTF-16LE encoding, and is filtered out. The string returned
is “This”.

You can also use String to extract a string from the Message
object after calling TriggerEvent or PostEvent. For more information,
see the TriggerEvent or PostEvent functions.

Examples

This example converts the blob instance variable ib_sblob, which
contains string data in ANSI format, to a string and stores the result
in sstr:

This example stores today’s date and test status information in
the blob bb. Pos1 and pos2 store the beginning and end of the status
text in the blob. Finally, BlobMid extracts a “sub-blob” that String
converts to a string. Sle_status displays the returned status
text:

See also

Blob

String method for DataWindows in the section called “String” in DataWindow Reference.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x