What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Enumerating through files in Win32

[?] Enumerating through files in Win32
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: [?] Enumerating through files in Win32
JScript code:
FileSystem.EnumerateFiles = function(Directory) {
    var ret = new Array();
    var result = this.FindFirstFile(Directory);
    if(result.hFind === 0) {
        result.WIN32_FIND_DATA.Size = 0;
        return ret;
    }
    do {
        var oResult = this.FindNextFile(result.hFind);
        ret.push(oResult);
    } while(oResult.hFind !== 0);
    return ret;
}

That does it; I guess that using the result object in the loop changes the references stored in the array..?
10-29-2011 09:37 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[?] Enumerating through files in Win32 - by SmokingCookie on 10-27-2011 at 07:54 PM
RE: [?] Enumerating through files in Win32 - by matty on 10-27-2011 at 09:31 PM
RE: [?] Enumerating through files in Win32 - by SmokingCookie on 10-29-2011 at 09:37 AM
RE: [?] Enumerating through files in Win32 - by matty on 10-31-2011 at 11:10 AM
RE: [?] Enumerating through files in Win32 - by SmokingCookie on 10-31-2011 at 02:45 PM
RE: [?] Enumerating through files in Win32 - by matty on 10-31-2011 at 02:53 PM
RE: [?] Enumerating through files in Win32 - by SmokingCookie on 10-31-2011 at 03:55 PM
RE: [?] Enumerating through files in Win32 - by matty on 10-31-2011 at 05:36 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On