Please enable JavaScript to view this site.

ESL Documentation

Prototype

subroutine EcsGetFieldType(integer:FieldNumber, integer:FieldType)

Description

Field-oriented. Copies the field type of a specified field into an integer variable.

Parameters

FieldNumber

Input

An integer denoting the field to be checked that must be greater than zero and less than or equal to the number of fields on the screen.

FieldType

Output

A reference to the integer that will receive the type of the specified field.

Field Types

ECS_FT_ALPHANUMERIC

3270 & 5250

field is Alpha Numeric

ECS_FT_ALPHA_ONLY

5250

field is Alpha Only

ECS_FT_NUMERIC_SHIFT

5250

field is Numeric Shift

ECS_FT_NUMERIC_ONLY

3270 & 5250

field is Numeric Only

ECS_FT_RESERVED

5250

field is Reserved

ECS_FT_DIGITS_ONLY

5250

field is Digits Only

ECS_FT_MAG_STRIPE

5250

field is Mag Stripe

ECS_FT_SIGNED_NUMERIC

5250

field is Signed Numeric

Return Value

ECS_E_NOTINIT

Not initialized - command was ignored

ECS_E_NOTCONN

Not connected to an active session

ECS_E_NOFLDS

Screen contains no fields

ECS_E_FLDNUM

Invalid field number

ECS_E_ERRORFREE

No errors were generated

Example

###*********************************************

###  Action to get a field type for 3270 Session

###*********************************************

action GetFieldType is

    copy text of FieldNum_SB in GetFieldType_DB to Field_IV

    call EcsGetFieldType ( Field_IV, FieldType_IV )

    copy errorlevel to ErrorLevel_IV

    copy "EcsGetFieldType" to Call_SV

    if ( ErrorLevel_IV = ECS_E_ERRORFREE ) then

        if (FieldType_IV = ECS_FT_NUMERIC_ONLY) then

           copy "Field is type numeric" to Message_SV

        else

           copy "Field is type alphanumeric" to Message_SV

        end if

        action DisplayMessage

    else

        action DisplayError

    end if

    make GetFieldType_DB invisible

    make GetFieldType_DB temporary