### Data Types

#### Standard data types

Supported

Appeon supports all standard PowerBuilder data types as outlined in the table below:

Table 172.

 Blob Boolean Byte Char or character Date DateTime Decimal or Dec* Double Integer or Int Long Real String Time UnsignedInteger, UnsignedInt, or UInt UnsignedLong or ULong

The decimal precision is extended from 15 digits to 28 digits in DataWindow. However, you cannot manipulate 28-digit Decimal in a datawindow via Get/Set function and dot notation.

Decimal in DataWindow

The decimal precision extends to 28 digits in a DataWindow by enabling the 28-digital Decimal option in AEM.

1. Precision

With 28-digit Decimal option, the decimal precision in DataWindow supports up to 28 digits and ranges from -39,614,081,257,132,168,796,771,975,167 to +39,614,081,257,132,168,796,771,975,167.

2. Function Limitations

• 28-digit Decimal supports the following arithmetic operators:

Arithmetic operators: "+", "-", "*", "/"

Relational operators: =, >, <, <>, >=, <=

• 28-digit Decimal is supported in the following DataWindow expressions: Abs, Avg, CumulativeSum, Median, Sign, and Sum.

3. Function Differences

• In the calculation, values/variables of Double or Real data type are handled as values/variables of Decimal data type.

• Constants in an expression will be handled as Double datatype if the expression is being dynamically modified and contains relational operators (=, >, <, <>, >=, <=).

• Constants in an expression will be handled as Decimal data type if the expression is being dynamically modified and contains arithmetic operators ("+", "-", "*", "/")

• Appending the letter D in uppercase or lowercase to identify a number as a decimal constant in a DataWindow expression is unsupported in 28-digit decimal.

• Decimal displaying in the DataWindow in Appeon may differ from that in PowerBuilder. Sometimes Decimal displays in scientific notation in PowerBuilder but displays in standard notation in Appeon.

• If exceeding 28 digits, the decimal number cannot be correctly displayed on mobile.

Differences

• UnsignedLong (32-bit) and UnsignedInteger (16-bit)

The UnsignedLong (32-bit) and UnsignedInteger (16-bit) data types are handled as Long and Integer. Therefore, the supported range for UnsignedLong is from 0 to 4,294,967,295, and the supported range for UnsignedInteger is from 0 to 65,535.

• Decimal, Real and Double

In operations that contain calculations of precision, values/variables of Decimal or Real data type are handled as values/variables of Double data type.

In operations that do not contain calculations of precision, values/variables of Double or Real data type are handled as values/variables of Decimal data type.

• You must ensure that the result of a numeric expression will not cause overflow in PowerBuilder. Otherwise the result on mobile is different from that in PowerBuilder.

Unsupported

Appeon does not support LongPtr data type.

#### Any data type

Any data type is fully supported, with the exception as follows:

• Assigning the return value of a String function to an Any variable that has not been previously assigned is unsupported.

• Using Any in the OCX is unsupported.

• Using Any array is only supported in the retrieval argument.

• Using Any array in a dot notation is unsupported. To work around it, you can use Any variable instead of Any array.

For example:

Unsupported code 1:

```Any la_data
La_data = dw_2.object.data
Dw_1.object.data = la_data
```

Unsupported code 2:

```Any la_data[ ]
La_data[1] = dw_2.object.data[1]
Dw_1.object.data[1] = la_data[1]
```

Supported code 1:

`dw_2.object.data = dw_1.object.data`

Supported code 2 (PowerServer Web only):

```any la_data1
la_data1 = dw_1.object.data
```

#### System object data types

Supported

• Autoinstantiated object data types:

NVOs (Class User Object) with their Autoinstantiate property checked;

Structure data types;

Autoinstantiated system objects: ListViewItem, TreeViewItem.

• Nonautoinstantiated object data types:

NVOs (Class User Object) with their Autoinstantiate property unchecked;

Visual controls (user-defined visual controls and system controls)

Nonautoinstantiated system objects, including: Application, DataStore, DataWindowChild, DynamicStagingArea, MDIClient, Menu, Message, Transaction Object, Window.

• PowerObject classes:

The supported PowerObject classes include DragObject, DWObject, GraphicObject, PowerObject, and WindowObject.

Note: In the mobile application, because the declaration of a PowerObject does not specify the object type, the initial value of the variable is NULL. Therefore, when the IsValid function is executed, IsValid returns NULL.

Unsupported

• Among all the supported system objects and system controls, if the data type is a non-global Transaction Object, the data type is not supported.

• If the data type is an unsupported system object or system control, it is unsupported.

• Do not refer to a DataWindow object by using global functions or instance variables. Otherwise the executing result will has error on mobile.

#### Enumerated data types

Supported

All system-defined enumerated data types and values (except JsonItemType) are supported, unless the enumerated data type belongs to an unsupported feature.

Unsupported

• JsonItemType enumerated data type is unsupported.

• Enumerated data types have predefined sets of values. Most of the PowerBuilder enumerated data types have default values. Using the default values of enumerated data types is unsupported.

#### Forced conversion between data types

Supported

1. Forced conversion between string and char data type:

• Assigning strings to char arrays

• Assigning char arrays to strings

• When a string literal is assigned to a char variable, the first character of the string literal is assigned to the variable.

For example:

```char c = "xyz" //results in the character x being
assigned to the char variable c.```
• Special characters (such as new line, form feed, octal, hex, etc.) can be assigned to char variables using string conversion.

For example:

`char c = "~n"`
• A char variable assigned to a string variable results in a one-character string.

• Expressions using both strings and char arrays promote the chars to strings before evaluation.

For example:

```char c if (c = "x") then // promotes the contents
of c to a string before comparison with the string "x"```
• Using chars in PowerScript functions. All PowerScript functions that take strings also take chars, subject to the above described conversion rules.

2. Forced conversion between numeric data types:

• The order of precedence in PowerBuilder regarding numeric data types is supported. The following is the order of precedence from highest to lowest (based on the range of values for each data type):

(High) Double >> Real >> Decimal >> UnsignedLong >> Long >> UnsignedInteger >> Integer (Low)

• If operands in an expression have different data types, the value whose type has lower precedence is converted to the data type with higher precedence.

For example:

```int x; x=2.4
PowerScript result: the value of x is actually 2,
because x is defined as an integer.
PowerBuilder will cut the digit after the decimal point, then assign 2 to x.
```
• Unsigned type has precedence over signed. So if one operand is signed and the other is unsigned, both are promoted to the unsigned version of the higher type. For example, if one operator is a Long and another an UnsignedInteger, both are promoted to UnsignedLong.

• Transform other numeric data types recessive to integer or int data. A force conversion from other numeric data to int/long data will arrive at the same value in PowerScript and JavaScript.

Unsupported

• In PowerBuilder, when Time data type is automatically converted into DateTime, the date is always 1900-01-01. Thus, the DataWindow always gets a value of DateTime type: Retrieve (1900-01-01 xx:xx:xx).However, if connected to a JDBC SQL Server, the default date is the current day. In other words, DataWindow gets Retrieve(today xx:xx:xx) when Time data type is automatically converted into DateTime.

Difference

When assigning a numeric number to an Any data, a forced conversion from Any to Integer may arrive at different values in PowerBuilder and on mobile. For example,

```Integer li_value
any la_value = 3.5
li_value = Integer(la_value) // li_value will be 3 on mobile and 4 in PowerBuilder.
```