[Gambas-user] Global search & replace

Benoît Minisini gambas at ...1...
Sun Apr 17 02:01:31 CEST 2011


> > You mean "in current file", not "in current directory", do you?
> 
> Oh, yes.. a lot of errors from me...
> 
> > And yes, it is logical to replace all only in the current file. Think
> > about renaming a private class variable, for example.
> 
> I think you misunderstand what I meant...
> This is what I mean (look also at attachment):
> 
> Public Sub btnReplaceAll_Click()
> 
>   If InitSearch() Then Return
> 
>   If chkCurrentFile.Value = True Then
> 
>      If Message.Question(Subst$(("Are you sure you want to replace all
> instances in this file of '&1' with '&2'?"), SearchString,
> ReplaceString),("Yes"), ("No")) <> 1 Then Return
> 
>     Run(GO_FORWARD + DO_REPLACE + DO_ALL)
>   Else
> 
>       If Message.Question(Subst$(("Are you sure you want to replace all
> instances of '&1' with '&2'?"), SearchString, ReplaceString),("Yes"),
> ("No")) <> 1 Then Return
> 
>     Browse(chkSourceOnly.Value, True)
>   Endif
> 
> End
> 
> Just testing it for errors... not my best day for me to concentrate.
> 
> 
> Jussi

I think what I have done in revision #3772 is a bit more practical. Tell me!

-- 
Benoît Minisini




More information about the User mailing list