_FINISHDROP

From QB64 Phoenix Edition Wiki
Revision as of 10:11, 29 March 2023 by RhoSigma (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The _FINISHDROP statement resets _TOTALDROPPEDFILES and clears the _DROPPEDFILE list of items (files/folders).


Syntax

_FINISHDROP


Description


Availability

  • Version 1.3 and up.


Examples

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

SCREEN _NEWIMAGE(128, 25, 0)

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

DO
    IF _TOTALDROPPEDFILES THEN
        FOR i = 1 TO _TOTALDROPPEDFILES
            a$ = _DROPPEDFILE(i)
            COLOR 15
            PRINT i,
            IF _FILEEXISTS(a$) THEN
                COLOR 2: PRINT "file",
            ELSE
                IF _DIREXISTS(a$) THEN
                    COLOR 3: PRINT "folder",
                ELSE
                    COLOR 4: PRINT "not found", 'highly unlikely, but who knows?
                END IF
            END IF
            COLOR 15
            PRINT a$
        NEXT
        _FINISHDROP 'If _FINISHDROP isn't called here then _TOTALDROPPEDFILES never gets reset.
    END IF

    _LIMIT 30
LOOP


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link