TYPE


ANSI, NCHAR

 

The TYPE instruction tests a character string variable for a valid numeric format. The instruction uses the following format:

 

(1)

[label]

TYPE

{dest}

(2)

[label]

TYPE

{var}[,{type}[,dim1[,dim2[,dim3]]]]

 

Where:

label

Optional. A Program Execution Label.

dest

Required. A previously defined Character String Variable or National Character String Variable tested for a valid numeric format.

var

Required. Any valid data variable reference type.

type

Required. A previously defined Numeric Variable that identifies the variable type.

dim1

Required. A previously defined Numeric Variable that returns the first dimension if {var} is an array.

dim2

Required. A previously defined Numeric Variable returns the second dimension if {var} is an array.

dim3

Required. A previously defined Numeric Variable returns the third dimension if {var} is an array.

Flags Affected: EOS, ZERO

Note the following:

  1. When the first syntax format is used, the {dest} variable can only be a DIM or NCHAR type variable. In this case, the TYPE instruction executes in a traditional manner to verify whether the string contents is a valid numeric format. The following rules apply to the traditional TYPE instruction:

  2. Generate/bullet1.gif    Only the Logical String contents of {dest} are tested. The contents remain unchanged.

    Generate/bullet1.gif    If the Logical String contains a valid numeric field format, the EQUAL (or ZERO) Condition Flag is set.

    Generate/bullet1.gif    If {dest} is a Null String, the EOS Condition Flag is set.

  1. The second syntax format returns the type and dimensions for a data variable reference. The following rules apply to the enhanced TYPE instruction:

  2. Generate/bullet1.gif    After the instruction, the {type} variable identifies the {var} variable type. Note that the values stored into the {type} operand can be controlled by the runtime keyword PLB_USEDBCTYPE={on | off} and the SETMODE keyword named *USEDBCTYPE.

    Generate/bullet1.gif    If {var} is not an array or does not contain the additional dimensions, the variables (dim1 - dim3) will contain a zero.

    Generate/bullet1.gif    If {dim1} is a non-zero value, the variable is an array and {type} represents the base type for the array.

    Generate/bullet1.gif    The type values returned are specified for a SUNBELT (default) set of values or for a SWDBC compatibility set of values.

     

    Data Items

     

    Data Type

    Sunbelt

    SWDBC

    Note

    DIM

    32 (0x20)

    1

     

    DIM Literal

    288 (0x120)

    257

    DIM type plus 0x100 (9.5A). The DIM Literal type value is ONLY generated when the VERB instruction is being used.

    FORM

    16 (0x10)

    2

     

    FORM Literal

    272(0x110)

    258

    FORM type plus 0x100 (9.5A)

    The FORM Literal type value is only generated when the VERB instruction is being used.

    INTEGER (1)

    264 (0x108)

    2

     

    INTEGER (2)

    520 (0x208)

    2

     

    INTEGER (3)

    776 (0x308)

    2

     

    INTEGER (4)

    1032 (0x408)

    2

     

    INTEGER (8)

    2056 (0x808)

    2

     

    DIMARRAY

    32 (0x20)

    3

    {dim1} != 0

    FORMARRY

    16 (0x10)

    4

    {dim1} != 0

    INTEGERARRAY(1)

    264 (0x108)

    4

    {dim1} != 0

    INTEGERARRAY(2)

    520 (0x208)

    4

    {dim1} != 0

    INTEGERARRAY(3)

    776 (0x308)

    4

    {dim1} != 0

    INTEGERARRAY(4)

    1032 (0x408)

    4

    {dim1} != 0

    INTEGERARRAY(8)

    205(0x808)

    4

    {dim1} != 0

    FILELIST

     20 (0x14)

    5

     

    VARLIST

    4 (0x4)

    5

     

    FILE

    64 (0x40)

    6

     

    IFILE

    65 (0x41)

    7

     

    AFILE

    66 (0x42)

    8

     

    COMFILE

    71 (0x47)

    9

     

    PFILE

    67 (0x43)

    15

     

    SNDFILE

     68 (0x44)

     

     

    DBFILE

    69 (0x45)

     

     

    BFILE

    70 (0x46)

     

     

    ADMIN

    73 (0x49)

     

     

    XFILE

    75 (0x4B)

     

     

    NCHAR

    544 (0x220)

    544

     DIM type plus 0x200 identifying a National Character String Variable.

     

    The PLB data definitions 'EQUATE', 'PROFILE', 'RECORD', and 'RECORD DEFINITION' are only used when compiling a PLB program. These data definitions cannot be used as the {var} for the TYPE instruction because they do not exist as data variables in the UDA of a PLB program.

     

         GUI Objects

     

    Data Type

    Sunbelt

    SWDBC

    Version

    BUTTON

    304 (0x130)

    16

     

    CHECKBOX

    560 (0x230)

    16

     

    CHECKGRP

    816 (0x330)

    16

     

    DATALIST

    1072 (0x430)

    16

     

    DIALOG

    1328 (0x530)

    16

     

    EDITTEXT

    1584 (0x630)

    16

     

    ICON

    1840 (0x730)

    16

     

    MENU

    2096 (0x830)

    16

     

    MREGION

    2352 (0x930)

    16

     

    MOVIE

    2608 (0xA30)

    16

     

    PICT

    2684 (0xB30)

    16

     

    POPUPMENU

    3120 (0xC30)

    16

     

    RADIOGRP

    3376 (0xD30)

    16

     

    RADIO

    3632 (0xE30)

    16

     

    SUBMENU

    3888 (0xF30)

    16

     

    STATTEXT

    4144 (0x1030)

    16

     

    TIMER

    4400 (0x1130)

    16

     

    COLOR

    4656 (0x1230)

    16

     

    FLOATMENU

    4912 (0x1330)

    16

     

    FONT

    5168 (0x1430)

    16

     

    GROUPBOX

    5424 (0x1530)

    16

     

    IMAGELIST

    5680 (0x1630)

    16

     

    LISTVIEW

    5936 (0x1730)

    16

     

    PROGRESS

    6192 (0x1830)

    16

     

    HSCROLLBAR

    6448 (0x1930)

    16

     

    VSCROLLBAR

    6704 (0x1A30)

    16

     

    STATUSBAR

    6960 (0x1B30)

    16

     

    TREEVIEW

    7216 (0x1C30)

    16

     

    TOOLBAR

    7472 (0x1D30)

    16

     

    WINDOW

    7728 (0x1E30)

    16

     

    COMBOBOX

    7984 (0x1F30)

    16

     

    SHAPE

    8240 (0x2030)

    16

     

    SLIDER

    8496 (0x2130)

    16

     

    TABCONTROL

    8752 (0x2230)

    16

     

    COLLECTION

    9008 (0x2330)

    16

     

    PLBFORM

    9264 (0x2430)

    16

     

    LINE

    9520 (0x2530)

    16

     

    AUTOMATION

    9776 (0x2630)

    16

     

    CONTAINER

    10032 (0x2730)

    16

     

    CONTROL

    10288 (0x2830)

    16

     

    VARIANT

    10544 (0x2930)

    16

     

    MAINWINDOW

    11056 (0x2B30)

    16

     

    STATUSPANEL

    11312 (0x2C30)

    16

     

    TOOLBUTTON

    11568 (0x2D30)

    16

     

    SPLITTER

    11824 (0x2E30)

    16

     

    PANEL

    12080 (0x2F30)

    16

     

    EDITNUMBER

    12336 (0x3030)

    16

     

    EDITDATETIME

    12592 (0x3130)

    16

     

    LABELTEXT

    12848 (0x3230)

    16

     

    ANIMATE

    13104 (0x3330)

    16

     

    MENUITEM

    13360 (0x3430)

    16

     

    RICHEDITTEXT

    13616 (0x3530)

    16

     

    NETOBJECT

    14128 (0x3730)

    16

     

    NETCONTROL

    14384 (0x3830)

    16

     

    CLIENT

    14640 (0x3930

    16

    9.7

    RUNTIME

    14896 (0x3A30

    16

    9.7

    XDATA

    15152 (0x3B30)

    16

    9.8A

    HTMLCONTROL

    15408 (0x3C30)

    16

    10.0A

 

See Also: Example Code, Character String Instructions

 



PL/B Language Reference TEST UNPACK