Previous Page Contents Page Next Page

4.9 Copy Presentation Space to String

The Copy Presentation Space to String function copies the contents of all or part of the current presentation space into a data string defined in your application program. Copied characters are translated to ASCII values before being stored in the data string.

4.9.1 Prior Functions

Your application program must be connected to a valid presentation space before issuing the request for this function. Use Connect Presentation Space to connect to a presentation space.

4.9.2 Request Parameters

Your application program must pass the following parameters to this function:

func_number

8 HA_COPY_PS_TO_STR

data_string

Empty data string defined in your application program. It must be large enough to hold the data that will be copied from the presentation space. Presentation Space Sizes, shows the PS sizes for each of the display models.

If the option is set in Set Session Parameters , the string must be twice as long as the number of character positions you want to copy, to allow for the EAB characters.

data_length

Number of bytes of data you want to copy from the presentation space (including the additional bytes if the or , or both, options are set-see above).

ps_position

Position in the presentation space where you want the function to begin copying.

4.9.3 Returned Parameters

This function returns the following parameters to your application program:

func_number

8

data_string

String copied from the presentation space.

data_length

The number of characters in the returned data string. If the field contained SO/SI characters and the option is set in Set Session Parameters, this will be less than the supplied data length because the SO/SI characters are not included in the returned string.

return_code

The valid return codes are:

HARC_SUCCESS

Function was successful; session is active and keyboard is unlocked. Contents of host presentation space were copied to your program.

HARC_NO_CONNECTION

Your application program is not connected to a valid presentation space.

HARC_BAD_PARM

The data_length parameter was not valid (either zero or greater than the PS size). No data was copied.

HARC_BUSY

Copy was successful, but presentation space is waiting for host response.

HARC_LOCKED

Copy was successful, but keyboard is locked.

HARC_INVALID_PS_POS

Your program specified a presentation space position that was zero or greater than the PS size.

HARC_SYSTEM_ERROR

System error occurred.

4.9.4 Affected by Set Session Parameters?

This function is affected by the following options of the Set Session Parameters function:

Causes field attribute bytes to be included unchanged in the returned string.

Causes field attribute bytes to be returned as blanks.

Copies each character from the presentation space followed by its extended attribute byte.

Does not copy attribute bytes.

If the option is set, causes the copied extended attribute bytes to be translated into CGA format.

If the option is set, causes extended attribute bytes to be copied without translation.

For more information, see Set Session Parameters.

4.9.5 Usage and Restrictions

Usage and restrictions are:

Previous Page Contents Page Top of Page Next page