To define an object so that a file can be dropped onto it, you must:

  • Set the DROP-TARGET attribute to TRUE for the object that you want to have accept the drop.
  • Code the DROP-FILE-NOTIFY event and end it with the END-FILE-DROP() method. The dropped file does not automatically open in an ABL object. You must explicitly write the code that assigns the dropped file to the object if you want to display the contents in the object (for example, if the object is an editor object).

Here is an example:

DEFINE VARIABLE editor-1 AS CHAR VIEW-AS EDITOR SIZE 40 BY 6 DROP-TARGET.
DEFINE FRAME frame-1 editor-1 WITH SIDE-LABELS THREE-D.

DEF VAR num AS INTEGER.
DEF VAR i AS INTEGER.
ON 'DROP-FILE-NOTIFY' OF editor-1
DO:
  num = editor-1:NUM-DROPPED-FILES.
  DO i = 1 TO num:
    editor-1:INSERT-FILE( editor-1:GET-DROPPED-FILE(i)).
  END.
  editor-1:END-FILE-DROP( ).
END.

UPDATE editor-1 WITH FRAME frame-1.