[Gambas-user] Global search & replace

Jussi Lahtinen jussi.lahtinen at ...626...
Sat Apr 16 19:16:03 CEST 2011


"intances", should be "instances"... sometimes hard to get it right....

Jussi


On Sat, Apr 16, 2011 at 20:12, Jussi Lahtinen <jussi.lahtinen at ...626...>wrote:

> Public Sub btnBrowseReplace_Click()
>
>   If InitSearch() Then Return
>
>
>   If Message.Question(Subst$(("Are you sure you want to replace all
> intances of '&1' with '&2'?"), SearchString, ReplaceString), ("Yes"),
> ("No")) <> 1 Then Return
>
>   Browse(chkSourceOnly.Value, True)
>
> End
>
>
> Jussi
>
>
>
>
> On Sat, Apr 16, 2011 at 20:03, Jussi Lahtinen <jussi.lahtinen at ...626...>wrote:
>
>> Hmmm... that's not good, my error... it will be asked also when you use
>> browse feature!
>> And I'm not sure it is very logical to have "Replace", "Replace all" and
>> "Browse and replace"...
>> "Replace all" should replace all, not just in current directory.
>>
>> Jussi
>>
>>
>>
>> On Sat, Apr 16, 2011 at 19:45, Jussi Lahtinen <jussi.lahtinen at ...626...>wrote:
>>
>>> It's good now, but I would like to see confirmation question, in case of
>>> accidental click on wrong button.
>>> My suggested code to FSearch:
>>>
>>> Private Sub Browse(Optional bOnlySource As Boolean, Optional bReplace As
>>> Boolean)
>>>
>>>   Dim sDir As String
>>>   Dim sFile As String
>>>   Dim sPath As String
>>>   Dim iPos As Integer
>>>   Dim iLen As Integer
>>>   Dim aFind As String[]
>>>   Dim sName As String
>>>   Dim sExt As String
>>>
>>>   If InitSearch() Then Return
>>>   'OnlySource = bOnlySource
>>>
>>> *  If Message.Question(Subst$(("Are you sure you want to replace all
>>> intances of '&1' with '&2'?"), SearchString, ReplaceString), ("Yes"),
>>> ("No")) <> 1 Then Return*
>>>
>>> ...
>>>
>>>
>>> Jussi
>>>
>>>
>>>
>>>
>>> 2011/4/15 Benoît Minisini <gambas at ...1...>
>>>
>>>> > On Tuesday 12 April 2011 20:41:20 Benoît Minisini wrote:
>>>> > > > On Sunday 10 April 2011 22:17:20 Olivier Cruilles wrote:
>>>> > > > Thanks, I'll try that, but I would have thought the gambas editor
>>>> > > > should accomodate global replaces.
>>>> > > >
>>>> > > > Regards
>>>> > > >
>>>> > > > Richard
>>>> > >
>>>> > > Global replace was added in revision #3753.
>>>> > >
>>>> > > To activate it, you must check the "Replace all" entry in the menu
>>>> of the
>>>> > > "Browse" MenuButton, just before starting browsing.
>>>> >
>>>> > That's a bit cryptic Benoit, there is room under the current procedure
>>>> > chekbox for a 'whole project' checkbox.
>>>> >
>>>> > REgards
>>>> >
>>>> > richard
>>>> >
>>>>
>>>> The global search & replace GUI should be simpler in revision #3765.
>>>>
>>>> Regards,
>>>>
>>>> --
>>>> Benoît Minisini
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Benefiting from Server Virtualization: Beyond Initial Workload
>>>> Consolidation -- Increasing the use of server virtualization is a top
>>>> priority.Virtualization can reduce costs, simplify management, and
>>>> improve
>>>> application availability and disaster protection. Learn more about
>>>> boosting
>>>> the value of server virtualization.
>>>> http://p.sf.net/sfu/vmware-sfdev2dev
>>>> _______________________________________________
>>>> Gambas-user mailing list
>>>> Gambas-user at lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>>
>>>
>>>
>>
>



More information about the User mailing list