English
Source / code snippets

Text in Files one Verzeichnisses search (XProfan X4)

 

p.specht

From Heinz Brill stammt following Posting:
"In one Ordner in all Files to one String Search and The suitable Lines spend (Lehrreich for use of MOVELISTPROC)":
Declare lever lb, list, edit1, btn1, btn2
Declare String way, such
Declare Long end
end = 0
list = Create("List", 1)
Window Title "Text - Sucher (XProfan-X4 Version of Heinz Brill)"
Window 800, 400
Create("Text", %HWnd, "Suchstring", 10, 10, 90, 25)
edit1 = Create("Edit", %HWnd, "", 100, 10, 180, 25)
btn1  = Create("Button", %HWnd, "Ordner wählen", 10, 60, 120, 25)
btn2  = Create("Button", %HWnd, "Start", 180, 60, 60, 25)
lb    = Create("Listbox", %HWnd, 0, 10, 120, 500, 200)

WhileNot end

    WaitInput

    If Clicked(btn1)

        way = $ ChooseDir("Wähle Ordner !")

    ElseIf Clicked(btn2)

        such = GetText$(edit1)

        If way <> ""

            CHDIR way

        Else

            way = $CurrentDir

        EndIf

        If such <> ""

            ClearList list
            ClearList 0
            Dateisuche()

        Else

            MessageBox("Bitte first Suchstring eintragen", "Fehler", 0)

        EndIf

    EndIf

    Case %Key = 2 : end = 1

EndWhile

Proc Dateisuche

    AddFiles "*.*"
    Move("ListToHandle", list)
    ClearList
    ClearList lb
    Set("MoveListMode", 1)

    WhileLoop 0, GetCount(list) - 1

        Ifnot InStr("[", GetString$(list, &LOOP))

            AddStrings(lb, GetString$(list, &LOOP) + "  date : " + DToc$(GetFDate$(GetString$(list, &LOOP))) + "   Time : " + GetFTime$(GetString$(list, &LOOP)))
            Move("FileToList", GetString$(list, &LOOP))
            AddStrings(lb, "     ")

        EndIf

    EndWhile

ENDPROC

MoveListProc
Parameters String s, Int i
Set("RegEx", 1)

If Get("MoveListMode") = 1

    If Match $(such, s) <> ""

        AddStrings(lb, Str $(i + 1) + ". row    " + s)

    EndIf

EndIf

Set("RegEx", 0)

ENDPROC

 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/30/21  
 



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

1.259 Views

Untitledvor 0 min.
Erhard Wirth06/14/24
Sven Bader05/24/23
funkheld01/01/22
p.specht11/20/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


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