News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Folder Listing

Started by ChillyWilly, February 14, 2010, 06:40:42 AM

Previous topic - Next topic

ChillyWilly

using icz code trying to figure out if there is a NOTZERO? for the test opcode
basically i want to get a list of folders in a directory and skip . and ..
right now the code lists files , how use test to check to see if attribute is a folder then list in msg box


FindFolders proc uses edi
  LOCAL finddata:WIN32_FIND_DATA
  LOCAL FHandle:DWORD

  invoke FindFirstFile,CTEXT("c:\test\*.*"),addr finddata
  .if eax!=INVALID_HANDLE_VALUE
    mov FHandle,eax
    xor edi,edi
    .while eax!=0
      test finddata.dwFileAttributes,FILE_ATTRIBUTE_DIRECTORY
      .if ZERO? ;;;;;;;;;;;;;;;;;;;;;;;;is there a NOTZERO?
      invoke lstrcmp,addr finddata.cFileName,CTEXT(".")
      cmp eax,0
      jz skip
      invoke lstrcmp,addr finddata.cFileName,CTEXT("..")
      cmp eax,0
      jz skip
      invoke MessageBox,0,addr finddata.cFileName,0,0
         inc edi
      .endif
      invoke FindNextFile,FHandle,addr finddata
    .endw
    invoke FindClose,FHandle
  .endif
  ret
FindFolders endp


donkey

The exclamation point is used as the NOT operator so...

!ZERO?
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ChillyWilly

lol why didnt i think of that  :U