Convert Position or Convert RowCol (99)

Top  Previous  Next

The Convert Position or Convert RowCol function converts the host presentation space positional value into the display row and column coordinates or converts the display row and column coordinates into the host presentation space positional value. This function does not change the cursor position.

 

3270

5250

Yes

Yes

 

 

Prerequisite Calls

 

There are no prerequisite calls for this function.

 

 

Call Parameters

 

 

Standard Interface                    Enhanced Interface

Function Number

Must be 99

Data String

Host presentation space short name and P for the Convert Position function (for example, AP converts the presentation space position of session A); or Host presentation space short name and R for the Convert RowCol function (for example, AR converts the row and column coordinates of session A).

Length

Row, when R is specified as the second character in the data string parameter. The lower limit for valid input is 1. The upper limit for valid input depends on how your host presentation space is configured. See 'Remarks'.  NA when P is specified as the second character in the data string parameter.

PS Position

Column, when R is specified as the second character in the data string parameter. The lower limit for valid input is 1. The upper limit for valid input ranges from 24 to 43 depending on how your host presentation space is configured. See Remarks.  Host presentation space position, when P is specified as the second character in the data string parameter. The lower limit for valid input is 1. The upper limit for valid input ranges from 1920 to 3564 depending on how your host presentation space is configured. See 'Remarks'.

 

The calling data string can contain:

 

Byte

 

Definition

Standard

Enhanced

 

1

1

A 1-character presentation space short name (PSID)

 

2-4

Reserved

2

5

Convert option P or R

 

6-8

Reserved

 

 

Return Parameters

 

This function returns a length and a return code.

 

Length

 

For the Convert Position function (P as the second character in the calling data string), a number between 1 and 43 (for PC/3270) or 27 (for PC400) is returned. This value is the number of the row that contains the PS position contained in the calling PS position parameter. The upper limit can be smaller than 43 (for PC/3270) or 27 (for PC400) depending on how the host presentation space is configured.

 

For the Convert RowCol function (R as the second character in the calling data string), a value of 0 indicates an error in the input value for row (calling length parameter).

 

Return Code

 

The Convert Position or RowCol function is the exception to the rule that the fourth return parameter always contains a return code. For this function, the value returned in the fourth parameter is called a status code. This status code can contain data or a return code. Your application must provide for processing of this status code to prevent unpredictable results or an error.

If the value of the fourth parameter is 0, 9998, or 9999, it is a return code.
For the Convert Position function (P as the second character of the calling data string), a value in the range of 1-132 is the number of the column that contains the PS position passed in the calling PS Position parameter. The upper limit can be smaller than 132 depending on how the host presentation space is configured.
For the Convert RowCol function (R as the second character of the calling data string), a value in the range of 1-3564 represents the host presentation space position that corresponds to the row and column values passed in the calling length and PS position parameters, respectively. The upper limit can be smaller than 3564 depending on how the host presentation space is configured.

 

The following status codes are defined:

 

Status Code

Explanation

0

This is an incorrect PS position or column.

>0

This is the PS position or column.

9998

An incorrect host presentation space ID was specified or a system error occurred.

9999

Character 2 in the data string is not P or R.

 

 

Remarks

 

To find out how many rows and columns are in your presentation space, examine the returned data string parameter for the Query Session Status (22) function.