Extract some files from directory

anakinanakin Member Posts: 27
Hi all,

somebody can post a sample code to loop to a pc directory for discover file that begin with 'act' (es. act.doc,act.txt,act.bak ecc.)

Thanks, anakin :lol:

Comments

  • WaldoWaldo Member Posts: 3,412
    Something like:
    CLEAR(RecFile); 
    RecFile.SETRANGE(Path, myPath); 
    RecFile.SETRANGE("Is a file", TRUE); 
    RecFile.SETFILTER(Name, 'act.*'); 
    // or RecFile.SETFILTER(Name,'%1*','act.');
    IF RecFile.FIND('-') THEN BEGIN 
    REPEAT 
    ...
    UNTIL recFile.NEXT = 0
    

    there is a lot to find about the "File"-table in this forum. Just search... .

    (Anakin - that's Darth Vader, father of Luke Skywalker. Use the "Search", Luke! ... :mrgreen: )

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.