From: Freddy Coal on
Hi, I would like make a search and replace in a file, for that I need get
the text in a textbox, but I need recognyze literally characters of the user
like a commands, for example:

The chain of the user is: "Hello world" & chr(64) & vbcrlf

If I capture the textbox, I get: ""Hello world" & chr(64) & vbcrlf"

But I would like get the string: "Hello world@" & vbcrlf

How make that?.

Thanks in advance.

Freddy Coal


From: Cor Ligthert[MVP] on
Freddy,

Be aware that this sample goes only about char which have an integer code
from 10 to 99 the rest you may to do yourself.

\\\
'assuming that you have first replaced your internal single quote by a
double quote, I assume it goes autmaticly but I did not test that.
Dim theString = "Hello world"" & Chr(64) & vbCrLf"
Dim charStart = theString.IndexOf("Chr")
Dim toUseChar = Chr(CInt(theString.Substring((charStart + 4), 2)))
Dim placeStart = theString.IndexOf("""")
theString = theString.Substring(0, placeStart) & toUseChar
///

Cor


"Freddy Coal" <freddycoal(a)gmaiwithoutspam.com> schreef in bericht
news:ehZ4frJ3IHA.5024(a)TK2MSFTNGP03.phx.gbl...
> Hi, I would like make a search and replace in a file, for that I need get
> the text in a textbox, but I need recognyze literally characters of the
> user like a commands, for example:
>
> The chain of the user is: "Hello world" & chr(64) & vbcrlf
>
> If I capture the textbox, I get: ""Hello world" & chr(64) & vbcrlf"
>
> But I would like get the string: "Hello world@" & vbcrlf
>
> How make that?.
>
> Thanks in advance.
>
> Freddy Coal
>

From: SurturZ on
You'll need to write a parser, or use a series of regexes or something like
that.

--
David Streeter
Synchrotech Software
Sydney Australia


"Freddy Coal" wrote:

> Hi, I would like make a search and replace in a file, for that I need get
> the text in a textbox, but I need recognyze literally characters of the user
> like a commands, for example:
>
> The chain of the user is: "Hello world" & chr(64) & vbcrlf
>
> If I capture the textbox, I get: ""Hello world" & chr(64) & vbcrlf"
>
> But I would like get the string: "Hello world@" & vbcrlf
>
> How make that?.
>
> Thanks in advance.
>
> Freddy Coal
>
>
>
From: Patrice on
Usually advanced search/replace capabilities are using regular expressions
rather than a VB Like syntax. See for example the search/replace included in
VS (and it allows much more powerfull scenarios)...


--
Patrice


"Freddy Coal" <freddycoal(a)gmaiwithoutspam.com> a �crit dans le message de
groupe de discussion : ehZ4frJ3IHA.5024(a)TK2MSFTNGP03.phx.gbl...
> Hi, I would like make a search and replace in a file, for that I need get
> the text in a textbox, but I need recognyze literally characters of the
> user like a commands, for example:
>
> The chain of the user is: "Hello world" & chr(64) & vbcrlf
>
> If I capture the textbox, I get: ""Hello world" & chr(64) & vbcrlf"
>
> But I would like get the string: "Hello world@" & vbcrlf
>
> How make that?.
>
> Thanks in advance.
>
> Freddy Coal
>

From: Cor Ligthert [MVP] on
Patrice,

Maybe you can make a little sample like I did for this problem, using string
methods.

Be aware that any regular expression is very much slower then any direct
method as you don't need more than 10 methods.

Cor

"Patrice" <http://www.chez.com/scribe/> schreef in bericht
news:eUdwQIO3IHA.3544(a)TK2MSFTNGP05.phx.gbl...
> Usually advanced search/replace capabilities are using regular expressions
> rather than a VB Like syntax. See for example the search/replace included
> in VS (and it allows much more powerfull scenarios)...
>
>
> --
> Patrice
>
>
> "Freddy Coal" <freddycoal(a)gmaiwithoutspam.com> a �crit dans le message de
> groupe de discussion : ehZ4frJ3IHA.5024(a)TK2MSFTNGP03.phx.gbl...
>> Hi, I would like make a search and replace in a file, for that I need get
>> the text in a textbox, but I need recognyze literally characters of the
>> user like a commands, for example:
>>
>> The chain of the user is: "Hello world" & chr(64) & vbcrlf
>>
>> If I capture the textbox, I get: ""Hello world" & chr(64) & vbcrlf"
>>
>> But I would like get the string: "Hello world@" & vbcrlf
>>
>> How make that?.
>>
>> Thanks in advance.
>>
>> Freddy Coal
>>
>