Copy Presentation Space to String (8)

Top  Previous  Next

The Copy Presentation Space to String function is used to copy all or part of the host-connected presentation space into a data string that you define in your EHLLAPI application program.

 

The input PS position is the offset into the host presentation space. This offset is based on a layout in which the upper-left corner (row 1/column 1) is location 1 and the bottom-right corner is 3564, which is the maximum screen size for the host presentation space. The value of PS Position + (Length - 1) cannot exceed the configured size of your host presentation space.

 

The Copy Presentation Space to String function translates the characters in the host source presentation space into ASCII. Attribute bytes and other characters not represented in ASCII normally are translated into blanks. If you do not want the attribute bytes translated into blanks, you can override this translation with the ATTRB option under the Set Session Parameters (9) function.

 

3270

5250

Yes

Yes

 

 

Prerequisite Calls

 

Connect Presentation Space (1)

 

 

Call Parameters

 

 

Standard Interface                              Enhanced Interface

Function Number

Must be 8

Data String

Preallocated target string the size of your host presentation space. When the Set Session Parameters (9) function with the EAB option is issued, the length of the data string must be at least twice the length of the presentation space.  DBCS Only: When the EAD option is specified, the length of the data string must be at least three times the length of the presentation space. When both the EAB and EAD options are specified, the length of the data string must be at least four times the length of the presentation space.

Length

Length of the target data string.

PS Position

Position within the host presentation space of the first byte in your target data string.

         

 

 

Return Parameters

 

This function returns a data string and a return code.

 

Data String

 

Contents of the host presentation space.

 

Return Code

 

The following codes are defined:

 

Return Code

Explanation

0

The host presentation space contents were copied to the application program. The target presentation space was active, and the keyboard was unlocked.

1

Your program is not connected to a host session.

2

An error was made in specifying string length, or the sum of (Length - 1) + PS position is greater than the size of the connected host presentation space.

4

The host presentation space contents were copied. The host presentation space was waiting for host response.

5

The host presentation space was copied. The keyboard was locked.

7

The host presentation space position is not valid.

9

A system error was encountered.

 

 

Remarks

 

1.An EAB can be returned when the Set Session Parameters (9) function EAB option is used. EAB is related to each character in the presentation space and is returned following each character.
2.DBCS Only: The Set Session Parameters (9) function EAD option is used with this function to return a 2-byte EAD. If the EAD option is specified instead of the EAB option, EAD is returned preceding each character. If both the EAB and EAD options are specified, EAD is returned following the EAB.
3.If the start position of the copy is at the second byte in the double-byte character, or the end position is at the first byte in the double-byte character, the bytes are translated into blanks. If the EAD option is set to on, three bytes are returned for each character. If both the EAB and EAD options are set to on, four bytes are returned for each character.
4.The Copy Presentation Space to String function is affected by the following options:
ATTRB/NOATTRB/NULLATTRB
EAB/NOEAB
XLATE/NOXLATE
BLANK/NOBLANK
DISPLAY/NODISPLAY
EAD/NOEAD (for DBCS only)
NOSO/SPACESO/SO (for DBCS only)
EXTEND_PS/NOEXTEND_PS
5.If the target data string provided is not large enough to hold the requested number of bytes, the copy ends successfully (RC=0, 4, or 5) when the end of the target data string is reached.
6.To use this function, preallocate memory to receive the returned data string parameter. The statements required to preallocate this memory vary depending on the language in which your application is written.