English
Source / code snippets

Files complex Subfolders Verzeichnisstrukturen

 

Peter
Mallow
These Prozedure seek after a Suchmaske in a beliebigen Ordner. Unterordner go thereby include.

To this object there of course already whom commands AddFiles, however is following Variante something variable and operates too with depths Verschaltelungen. unfortunately is the Prozedure something slow in reinen Profan, but Perhaps can tappt im dunkeln Yes someone in Assembler write or improve. faster operates The Prozedure, if The Listbox cache becomes (HideWindow()).
CompileMarkSeparation
Declare Listbox%

Proc ListFolder

    Parameters LBox%,Dir$,Filter$,Level%
    Declare String$,File$,c%,g%
    Level 0 = Nur den Hauptordner durchsuchen (Unterordner werden gelistet)
    Level 1 = Nur den Hauptordner durchsuchen (Unterordner werden nicht gelistet)
    Level 2 = Alles durchsuchen, samt Unterordner
    Beispiel: Print @ListFolder(Listbox%,"C:Programme","*.exe|*.bat",2)

    Proc Einlesen

        Parameters Dir$
        Declare i%,j%,len%
        ChDir Dir$
        File$ = @FindFirst$("*")
        i% = 0

        While File$ <> ""

            len% = @Len(File$)

            If (File$ <> "[.]") And (File$ <> "[..]")

                If (@InStr("[",File$) = 1) And (@InStr("]",File$) = len%)

                    String$ = @Translate$(File$,"[","")
                    String$ = @Translate$(String$,"]","")
                    Inc i%
                    @AddString(LBox%,Dir$+""+String$)

                Else

                    j% = 1

                    While @SubStr$(Filter$,j%,"|") <> ""

                        If @InStr(@SubStr$(Filter$,j%,"|"),File$) = (len% - @Len(@SubStr$(Filter$,j%,"|"))+1)

                            Inc i%
                            @AddString(LBox%,Dir$+""+File$)
                            break

                        EndIf

                        Inc j%

                    WEnd

                EndIf

            EndIf

            File$ = @FindNext$()

        WEnd

        g% = g%+i%

    EndProc

    Filter$ = @Translate$(Filter$,"*","")
    Einlesen Dir$

    If Level%

        While c% < g%

            String$ = @GetString$(LBox%,c%)

            If @TestBit(@GetFAttr(String$),4) Ordner finden

                @DeleteString(LBox%,c%)
                Dec g%
                Case Level% = 2: Einlesen String$ Ordner einlesen

            Else

                Inc c%

            EndIf

        WEnd

    EndIf

    Return g%

EndProc

Cls
UseFont "MS Sans Serif",15,6,0,0,0
SetDialogFont 1
Listbox% = @Create("ListBox",%HWnd,"",0,50,@Width(%HWnd)-5,@Height(%HWnd)-55)
Print @Str$(@ListFolder(Listbox%,"C:Programme","*.exe|*.bat",2))+" Dateien gelistet"
WaitInput
End
 
WinXP Pro SP2, XProfan 9 + XPSE
AMD Athlon 64 X2 3800
12/04/05  
 




Don
Bubu
tja,colleague
there must I you unfortunately disappoint
something like Have so did i Schonmal in profane 5.0 written.
funtzt on itself too integrally well only ...
The request with the [ can you crux.
after I larger ones ordner dursucht having , wunderte I over ands over again over the Difference Why windows More datein and ordner found having as my prg.to longer tests and mach and institute of technology Have ichs then found.
it given Files The ditto these klammer [ used and accordingly then as ordner angesehn get.
means becomes the so nothing ^^
würd there well sooner on The winapi sheer .
 
12/05/05  
 



the the [-characters too in Files vorkommen can I had Roland already written - and so I the [-characters for Ordnerattribut too completely fehl on the Space find.

Peter should its [-request with DirExists strain.

salvo.
 
12/05/05  
 




Michael
Dell
Perhaps would one AddFolders for next XProfan Version appropriate?
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
09/12/06  
 



Yes the The characters [|] unfortunately too in names vorkommen could observed so did i already on. I can Yes next to the Wildcards.Dll quick ne Addfiles.Dll building.
 
09/12/06  
 



would be beautiful.
 
09/12/06  
 




RGH
[quote:dabfe1781c=iF]the the [-characters too in Files vorkommen can I had Roland already written - and so I the [-characters for Ordnerattribut too completely fehl on the Space find.

Peter should its [-request with DirExists strain.[/quote:dabfe1781c]
this is indeed of/ one the Hauptgründe, why I DirExists() installed have. The Einklammerung of Verzerichnisnamen in eckigen clinging was under windows 3.x of system since pretended. (any Win 3.1-File-Auswahldialoge showed accordingly The eckigen clinging.) then durfte this characters naturally not whom 8.3-Filenames vorkommen. from Kompatibilitätsgründen watts the then too with 32-bit-versions of XProfan to maintain. means if one name of [ and ] locked in is, ought to one as a precaution to check on, whether it a directory or not.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
09/12/06  
 




Jörg
Sellmeyer
[quote:97eb00a4a9=Michael Dell]Perhaps would one AddFolders for next XProfan Version appropriate?[/quote:97eb00a4a9]
Something like have I me already since at least 2-3 years desired!!
(unfortunately this time not on it virtual it on The wishlist To write)
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
09/12/06  
 



[quote:e37e54c635=Jörg Sellmeyer][quote:e37e54c635=Michael Dell]Perhaps would one AddFolders for next XProfan Version appropriate?[/quote:e37e54c635]
Something like have I me already since at least 2-3 years desired!!
(unfortunately this time not on it virtual it on The wishlist To write)[/quote:e37e54c635]
look time Have strain ne Addfiles.Dll [...]  posted The has these function intus.
 
09/12/06  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

13.401 Views

Untitledvor 0 min.
Member 862464104/22/24
Michael Borowiak11/17/14
Klaus Ernst02/26/14
Ernst04/17/13
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie