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

GetItemDecimal – PB Docs 2022 – PowerBuilder Library

GetItemDecimal – PB Docs 2022

GetItemDecimal

PowerScript function

Syntax 1: GetItemDecimal (Long ItemHandle)

Syntax 2: GetItemDecimal (long ParentItemHandle, string
szKey)

Syntax 3: GetItemDecimal (string szPath)

Syntax 1

Description

Gets the value of the item whose type is decimal.

Applies to

JSONParser
objects

Syntax

Argument

Description

objectname

The name of the JSONParser object whose item value you
want to obtain.

ItemHandle

A long whose value is the handle of the item of
JsonNumberItem type.

Return value

Decimal.

Returns the decimal value of the item if it succeeds; if any
argument’s value is null, returns null; if an error occurs, throws the
exception.

Usage

If the item value is null, this function will throw an error,
therefore, it is recommended that before executing this function, call
GetItemType to check if the item
value is null. See example
2
in GetItemArray.

Examples

This example gets the decimal value of the first item:

Syntax 2

Description

Gets the value of the item whose type is decimal.

Applies to

JSONParser
objects

Syntax

Argument

Description

objectname

The name of the JSONParser object whose child item value
you want to obtain.

ParentItemHandle

A long whose value is the handle of the parent item of
JsonObjectItem type.

szKey

A string whose value is the key of the child item of
JsonNumberItem type.

Return value

Decimal.

Returns the decimal value of the child item if it succeeds; if any
argument’s value is null, returns null; if an error occurs, throws the
exception.

Usage

If the item value is null, this function will throw an error,
therefore, it is recommended that before executing this function, call
GetItemType to check if the item
value is null. See example
2
in GetItemArray.

Examples

This example gets the value of the “MessageID” item:

Syntax 3

Description

Gets the value of the item whose type is decimal.

Applies to

JSONParser
objects

Syntax

Argument

Description

objectname

The name of the JSONParser object whose item value you
want to obtain.

szPath

A string whose value is the path of the item of
JsonNumberItem type. If there is a multi-dimensional array,
use the number to indicate the order of the array. If a key
name contains “/”, use the escape character “~~/” to replace
“/”.

Return value

Decimal.

Returns the decimal value of the item if it succeeds; if any
argument’s value is null, returns null; if an error occurs, throws the
exception.

Usage

If the item value is null, this function will throw an error,
therefore, it is recommended that before executing this function, call
GetItemType to check if the item
value is null. See example
2
in GetItemArray.

Examples

This example gets the value of the first item according to its
item path:

See also

GetItemArray

GetItemArrayJSONString

GetItemBlob

GetItemBoolean

GetItemByPath

GetItemDate

GetItemNumber

GetItemObject

GetItemObjectJSONString

GetItemString

GetItemTime

GetItemType

GetNumberType


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