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

Byte – PB Docs 150 – PowerBuilder Library

Byte – PB Docs 150

Byte PowerScript function

Description

Converts a number into a Byte datatype
or obtains a Byte value stored in a blob.

Syntax

Argument

Description

stringorblob

A String or any
numeric datatype that you want to return as a Byte, or
a Blob datatype in which the initial value
is the Byte value that you want to return.
The stringorblob variable can also have an Any datatype
as long as it references a string, integer, uint, long, longlong,
or blob.

Return Values

Byte. Returns the value of the stringorblob variable
as a Byte datatype if it succeeds; it returns
0 if the stringorblob variable is not a valid
PowerScript number or if it has an incompatible datatype. If stringorblob is null, Byte returns null.

Usage

If the number you convert exceeds the upper range of the Byte
datatype (>255), the Byte method returns
the difference between the number you pass in the stringorblob argument
and the nearest multiple of 256 below that number.

If you pass a blob in the stringorblob argument,
only the value of the initial character is converted to a byte value.
(There is no “overflow” when you use a blob argument.)
To get the byte value for a character at a different position in the
blob, you can use the GetByte method.

Examples

This example converts a string entered in a SingleLineEdit
control to a byte value:

If the text entered in the SingleLineEdit is 4, the byte value
of ly_byte is 4. If the text entered
is 257, the value of ly_byte is 1.
For 256 or text such as “ABC12”, the value of
ly_byte is 0.

This example returns the ASCII value of the initial
character that you enter in a SingleLineEdit control:

See Also


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