English
Source / code snippets

Files Search Text

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Text search (in Files)
executable ex Profan-Version 5.0
declare i%,listbox1&,Listbox2&,input$,button0&
declare File$,row$,File$,z%,ok%,edit2&,fz$
declare ok$,edit&,button1&,button2&,len%,fz2$,number$
declare radiobutton1&,radiobutton2&,found%,text&

PROC KLICK          WICHTIG WEGEN EINFACHKLICK

    getmessage
    Case (%message,512): Return

ENDPROC

PROC SEARCH

    let found%=0
    @destroywindow(Listbox1&)  circa anew To fill
    @destroywindow(Listbox2&)  circa anew To fill
    and restore
    Let ListBox2&=CreateListBox(%hwnd,,10,200,472,97)
    Let ListBox1&=CreateListBox(%hwnd,,10,10,472,97)
    FILEMODE 0
    let I%=0
    let input$=GETTEXT$(EDIT&)
    assign #1,File$
    reset #1
    Clear ok$

    whilenot eof(#1)

        input #1,row$
        addstring(LISTBOX1&,@UPPER$($ row))

    wend

    close #1
    assign #1,File$
    reset #1
    case @GetCheck(Radiobutton1&):let input$=input$;
    let fz$=mid$(input$,1,1)
    len%=@Len(input$)

    whilenot eof(#1)

        input #1,row$
        let OK$=getstring$(LISTBOX1&,i%)
        let ok%=@Instr(upper$(input$),OK$)

        if @gt(ok%,0)

            if @GetCheck(Radiobutton1&)

                let OK$=@Mid$(OK$,ok%,len%)
                let ok$=upper$(ok$)
                let ok$=ok$;
                row$=@Trim $($ row)
                let fz2$=mid$(row$,1,1)
                let input$=upper$(input$,)

                if @and( @equ$(input$,ok$),equ$(fz$,fz2$))

                    ADDString(LISTBOX2&,row$)
                    inc found%
                    let number$=it get ,found%;x ,input$, in,File$,found
                    settext text&,number$

                endif

            Elseif @getcheck(Radiobutton2&)

                let OK$=@Mid$(OK$,ok%,len%)
                let ok$=upper$(ok$)
                let input$=upper$(input$)

                if @equ$(input$,ok$)

                    ADDString(LISTBOX2&,row$)
                    inc found%
                    let number$=it get ,found%;x ,input$, in,File$,found
                    settext text&,number$

                endif

            Endif

        endif

        INC I%

    WEND

    CLOSE #1
    let number$=it get ,found%;x ,input$, in,File$,found
    settext text&,number$

ENDPROC

SetTrueColor 1
Window Style $003F
Window 10,10-500,400
Windowtitle After Text search
UseFont MS Sans Serif,13,0,0,0,0
SetDialogFont 1
cls RGB(192,192,192)
Let ListBox2&=CreateListBox(%hwnd,,10,200,472,97)
Let ListBox1&=CreateListBox(%hwnd,,10,10,472,97)
Let Edit2&=CreateEdit(%hwnd,here File (or Button clicking),11,160,172,21)
Let Edit&=CreateEdit(%hwnd,here Suchtext,10,120,172,21)
Let Button1&=CreateButton(%hwnd,GO!,240,120,80,25)
Let Button2&=CreateButton(%hwnd,File dial,240,160,80,25)
let button0&=CreateButton(%hwnd,,0,0,0,0)  so Program whom Focus rather settle can
Let RadioButton1&=CreateRadioButton(%hwnd,Text very search,340,120,140,17)
Let RadioButton2&=CreateRadioButton(%hwnd,Text about search,340,140,140,17)
Let Text&=CreateText(%hwnd,here becomes The found Suchanzahl displayed,10,320,470,17)
setcheck Radiobutton1&,1

while 1

    waitinput

    if getfocus(button2&)

        KLICK
        let File$=@LOADFILE$(ÖFFNE:,*.prf)
        settext edit2&,File$
        setfocus(button0&)

    elseif getfocus(button1&)

        KLICK

        if @and(@neq$(File$,),@neq$(gettext$(Edit&),here Suchtext))

            SEARCH

        elseif @equ$(File$,)

            @MessageBox(Please File dial,Error,16)

        elseif @equ$(gettext$(Edit&),here Suchtext)

            @MessageBox(Please right Suchtext prompt!,Error,16)

        endif

        setfocus(button0&)

    endif

wend

 
07/15/07  
 



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

3.925 Views

Untitledvor 0 min.
Michael Hettner09/21/23
Info (3)03/20/21
AndreasS01/02/19
Helmut07/17/18
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (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