Skip to content
github-actions[bot] edited this page Jun 16, 2022 · 5 revisions

The _DROPPEDFILE function returns the list of items (files or folders) dropped in a program's window after _ACCEPTFILEDROP is enabled.

Syntax 1

= _DROPPEDFILE
Syntax 2
= _DROPPEDFILE()

Availability

  • Version 1.3 and up.
Example: Accepting files dragged from a folder and processing the list received by specifying an index.

(128, 25, 0)

'enables drag/drop functionality "Drag files from a folder and drop them in this window..."

    {{Cl|IF}} {{Cl|_TOTALDROPPEDFILES}} {{Cl|THEN}}
        {{Cl|FOR}} i = 1 {{Cl|TO}} {{Cl|_TOTALDROPPEDFILES}}
            a$ = {{Cl|_DROPPEDFILE}}(i)
            {{Cl|COLOR}} 15
            {{Cl|PRINT}} i,
            {{Cl|IF}} {{Cl|_FILEEXISTS}}(a$) {{Cl|THEN}}
                {{Cl|COLOR}} 2: {{Cl|PRINT}} "file",
            {{Cl|ELSE}}
                {{Cl|IF}} {{Cl|_DIREXISTS}}(a$) {{Cl|THEN}}
                    {{Cl|COLOR}} 3: {{Cl|PRINT}} "folder",
                {{Cl|ELSE}}
                    {{Cl|COLOR}} 4: {{Cl|PRINT}} "not found", 'highly unlikely, but who knows?
                {{Cl|END IF}}
            {{Cl|END IF}}
            {{Cl|COLOR}} 15
            {{Cl|PRINT}} a$
        {{Cl|NEXT}}
        {{Cl|_FINISHDROP}}
    {{Cl|END IF}}
    {{Cl|_LIMIT}} 30

Clone this wiki locally