fgl_dialog_setselection()

fgl_dialog_setselection() is used to select a text string within the current field. The function can be invoked only from the control blocks operating with the current fields, not in AFTER FIELD, AFTER ROW, etc.

The syntax of the function invocation is as follows:

CALL fgl_dialog_setselection(start, end)

where

start specifies the initial position of the edit cursor, and

end specifies the position of the selection end.

end can be more, less, or equal to start .

Here is a simple example:

MAIN

DEFINE

rec1 RECORD

f1 char(20),

f2 char(20)

end record

OPEN WINDOW w1 WITH FORM "fgl_dialog_setselection_function"

INPUT BY NAME rec1.* WITHOUT DEFAULTS

      

      ON KEY (ACCEPT)

      IF INFIELD(F1) THEN

              CALL fgl_dialog_setbuffer("123456789")

              CALL fgl_dialog_setselection(2,5)

      END IF

      IF INFIELD(F2) THEN

              CALL fgl_dialog_setbuffer("987654321")

              CALL fgl_dialog_setselection(3,8)

      END IF

END INPUT

CLOSE WINDOW w1

END MAIN

.per form code

DATABASE FORMONLY

SCREEN

{

[f1                       ]

[f2                       ]

}

ATTRIBUTES

f1=FORMONLY.f1;

f2=FORMONLY.f2;

INSTRUCTIONS

SCREEN RECORD s_rec (

      FORMONLY.f1,

      FORMONLY.f2

      )

DELIMITERS "[]"

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.