I am actually having a little bit complicated situation.
Inside a search() fucntion, can I use, variables.
The part of the code is given below.


    let rs_sig = expand("<cword>")
    exec '1'
    exec '/^\s*module\s\+\w\+'
    let rs_line=getline(".")
    let rs_ModuleName=matchstr(rs_line,"\\<\\w\\+\\>",0,2)
    exec 'tabedit D:\Profiles\r66203\_tags\LF\debussy.harlech'
    if search('/^' . rs_sig . '\t' . rs_ModuleName . '\t') != 0
        echo "Got the signal inside a module"
    else
        echo "Not got it"
    endif

Thanks,
Shankar

>-----Original Message-----
>From: Jürgen Krämer [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, July 25, 2006 3:28 PM
>To: vim mailing list
>Subject: Re: search and result
>
>
>Hi,
>
>SHANKAR R-R66203 wrote:
>>
>> In a function,
>>    I am executing a search.
>>    I have to implement different things based on whether search got a
>> result or failed with an error.
>>
>>   exec '/^\w\+\t\w\+'
>>
>> In the next line, I have to check whether the test passed or failed.
>>
>> How do I do this ?
>
>use the search() function:
>
>  if search('/^\w\+\t\w\+') != 0
>    " do something
>  endif
>
>Regards,
>Jürgen
>
>--
>Jürgen Krämer                              Softwareentwicklung
>HABEL GmbH & Co. KG                        mailto:[EMAIL PROTECTED]
>Hinteres Öschle 2                          Tel: +49 / 74 61 / 93 53 - 15
>78604 Rietheim-Weilheim                    Fax: +49 / 74 61 / 93 53 - 99

Reply via email to