Skip to content

UChar Array Support

Overview

An unsigned char (UChar) is a byte. An array of UChar is therefore an array of bytes. In applications, arrays of bytes can be used to represent (single byte) character data or binary data.

In DataFlex, Strings are normally used to represent character data, and Strings or a memory heap is used to represent binary data. With strings, you have a maximum argument size limitation, and if used for binary data, you also have to be very careful about embedded nulls. With memory, you have to allocate and deallocate the memory yourself and then work with low-level memory commands.

An alternative to these approaches is to use UChar arrays.

Command Changes

A number of commands have been changed and new global functions added as part of the changes in UChar Array Support.

Set_Field_Value

The Set_Field_Value command can now be passed a UChar array, and it will write the entire array to the table’s column buffer.

Get_Field_Value

The Get_Field_Value command can now return a UChar array.

Write

The Write command can now be passed a UChar array, and it will write the entire array to the sequential output device.

Read_Block

The Read_Block command can now receive the data in a UChar array.

New Global Functions

See Also