Hi,

1. What is PROFIND using exactly. Is it searching in only .rap file or the files inside project also? Meanwhile it is not in RadAsm.inc but there is just a pointer to struct. I find struct in an addin but also not sure about members' functionality.

2. Can i use this function to find a word in whole project? I fact i found another way but not liked much. How do searching a string in whole project?

3. How can i learn which files opened in project? And set it active?

4. ... forgot :)

That's all now.

cheers
Posted on 2005-09-27 12:24:41 by cakmak
Hi

1. This is some code in radasm that uses ProFind. It will open the file where the word(s) are found


lpFind=Test,3    Serches for the word Test. The 3 means whole word and case sensitive. Can be more than one word like: Test,3,if,0
lpNot=;'"          Can be a pointer to a zero lenght string

ProScan proc lpFind:DWORD,lpNot:DWORD
    LOCAL  iNbr:DWORD
    LOCAL  pf:PROFIND
    LOCAL  chrg:CHARRANGE

    mov    iNbr,1
    m2m    pf.lpFind,lpFind
    m2m    pf.lpNot,lpNot
    mov    pf.lpLine,offset LineTxt
    mov    pf.nMiss,0
  Nx:
    mov    pf.nFun,0
    mov    pf.hMem,0
    m2m    pf.nFile,iNbr
    mov    pf.pFile,0
    mov    pf.pMem,0
    mov    pf.pLine,0
    invoke ProFind,addr pf
    ;Free mem
    mov    pf.nFun,1
    invoke ProFind,addr pf
    .if pf.pLine==-1
        inc    iNbr
        .if pf.nMiss==10
            .if iNbr<1000
                mov    pf.nMiss,0
                mov    iNbr,1000
                jmp    Nx
            .endif
        .else
            jmp    Nx
        .endif
        ;Not found
        mov    eax,FALSE
        ret
    .endif
    invoke GetFileNameFromID,iNbr
    push    eax
    invoke strcpy,addr FileName,addr ProjectPath
    pop    eax
    invoke strcat,addr FileName,eax
    invoke ProjectOpenFile,TRUE
    .if !hFound
        mov    pf.nFun,0
        mov    pf.hMem,0
        m2m    pf.nFile,iNbr
        mov    pf.pFile,0
        mov    pf.pMem,0
        mov    pf.pLine,0
        invoke ProFind,addr pf
    .endif
    invoke SendMessage,hEdit,EM_EXLINEFROMCHAR,0,pf.pFile
    .if eax
        dec    eax
    .endif
    invoke SendMessage,hEdit,EM_LINEINDEX,eax,0
    mov    chrg.cpMin,eax
    mov    chrg.cpMax,eax
    invoke SendMessage,hEdit,EM_EXSETSEL,0,addr chrg
    invoke VerticalCenter,hEdit,REM_VCENTER
    mov    eax,TRUE
    ret

ProScan endp


2. Yes but I recomend using lpProScan. It is simpler.
3. Use lpOpenProjectFile. It will open or activate a project file.

KetilO
Posted on 2005-09-27 14:55:52 by KetilO
Hi,
3. Use lpOpenProjectFile. It will open or activate a project file.


Oh, god sake! I thought it is not opening already opened files. It was the most time consumer thing for me. Raked tab controls, opened handel arrays for mdichild, raedits... so i made a mistake somewhere. lpOpenProjectFile will both open and/or activate...

Thank you very much.
Posted on 2005-09-28 12:17:46 by cakmak