Inquire on control with only the id known

  • We don't use Acubench
  • We work with the screen section
  • Every control has an ID assigned by us

Is it possible to inquire the current control if you only know the id ?

  • I do not think so ... since you are assigning an ID to each control, aren't you also assigning a handle to each control? The INQUIRE statement uses the handle for the control you are inquiring. The control's USAGE HANDLE data item identifies the control to be inquired.

    Just confirming with an example.

    01 my-screen.

       05 my-1st-ef entry-field line, size, ID=5

     

    You want to inquire on 5? Whereas in my example it would be inquire my-1st-ef.

  • The reason for my question and what I want to achive is still to highlight the current field.

    I tried a massive EVALUATE where I connect the ids with the index of my color-table.
    But this is very tiresome and quite a challenge if you have to do it afterwards for a whole projekt and I'm looking for a better way.

    Is the control-id of the current field the only information I can get in the before procedure ?
    What about the handle "that is also created, when you create a control".
    Do I have to declare the handle or does the runtime this internally ?
  • I do not know if this can be you of it I use these two routines to color the field in which the cursor is located
    in the screen section in the before section i color of yellow the field that resets in the after as in the example below

    Dati di working
    * SERVE PER COLORARE DI GIALLO IL CAMPO IN USO
    77 WRK-GIALLO PIC 9(6) VALUE 480.
    88 SW-GIALLO VALUE 480.
    88 SW-GRIGIO VALUE 257.
    88 SW-BIANCONERO VALUE 513.
    ** 77 WRK-SEL-TXT PIC X(30) VALUE SPACES.
    77 WRK-CTL PIC 99 VALUE ZERO.
    88 88-LABEL VALUE 1.
    88 88-ENTRY-FIELD VALUE 2.
    88 88-PUSH-BUTTON VALUE 3.
    88 88-CHECK-BOX VALUE 4.
    88 88-RADIO-BUTTON VALUE 5.
    88 88-SCROLL-BAR VALUE 6.
    88 88-LIST-BOX VALUE 7.
    88 88-COMBO-BOX VALUE 8.
    88 88-FRAME VALUE 9.
    88 88-TAB VALUE 10.
    88 88-BAR VALUE 11.
    88 88-GRID VALUE 12.
    88 88-BITMAP VALUE 13.
    88 88-TREE-VIEW VALUE 14.
    88 88-WEB-BROWSER VALUE 15.
    88 88-ACTIVE-X VALUE 16.
    88 88-STATUS-BAR VALUE 17.
    88 88-DATE-ENTRY VALUE 18.
    screen section

    03 SC-DATI-Ef-3, Entry-Field,
    COL 15,50, LINE 4,50, LINES 2,30 CELLS, SIZE 21,20 CELLS,
    3-D, FONT IS Verdana12B, ID IS 14, VALUE WRK-COM,
    AFTER PROCEDURE SC-DATI-Ef-3-Aft-Procedure,
    BEFORE PROCEDURE SC-DATI-Ef-3-Bef-Procedure.
    03 SC-DATI-Cm-1, Combo-Box,
    COL 15,50, LINE 16,30, LINES 32,60 CELLS, SIZE 41,40 CELLS,
    3-D, FONT IS Verdana12B, ID IS 16, MASS-UPDATE 0,
    NOTIFY-SELCHANGE, DROP-LIST, UNSORTED,
    VALUE WRK-ORD,
    AFTER PROCEDURE SC-DATI-Cm-1-Aft-Procedure,
    BEFORE PROCEDURE SC-DATI-Cm-1-Bef-Procedure,
    EXCEPTION PROCEDURE SC-DATI-Cm-1-Exception-Proc.


    Procedure division
    *
    SC-DATI-Ef-3-Bef-Procedure.
    PERFORM COLORE-GIALLO.
    *
    SC-DATI-Ef-3-Aft-Procedure.
    PERFORM COLORE-BIANCONERO.
    *
    SC-DATI-Cm-1-Bef-Procedure.
    PERFORM COLORE-GIALLO.
    *
    SC-DATI-Cm-1-Aft-Procedure.
    PERFORM COLORE-BIANCONERO.
    *
    COLORE-GIALLO.
    SET SW-GIALLO TO TRUE.
    MODIFY CONTROL-HANDLE COLOR = WRK-GIALLO.
    COLORE-BIANCONERO.
    INQUIRE CONTROL-HANDLE, CLASS IN WRK-CTL.
    SET SW-GRIGIO TO TRUE.
    IF 88-ENTRY-FIELD
    OR 88-LIST-BOX
    OR 88-COMBO-BOX
    SET SW-BIANCONERO TO TRUE.
    MODIFY CONTROL-HANDLE COLOR = WRK-GIALLO.
  • Verified Answer

    "CONTROL-HANDLE" was the one word that I was looking for.

    That opens up a whole range of oppurtunities.

    Thanks a lot.

    One more question:

    Do you use WIN32_NATIVECTLS=1 ?

    If so: Does your combo-boxes show the color ? Mines stay dark grey and you can see the color only after opening the selection.
  • I use WIN32-3D = 1 and yes i have the same behavior on combo box