For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > November 2005 > Need help with replacing multiple strings of code









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Need help with replacing multiple strings of code
Jack

2005-11-27, 6:55 pm

I have this problem.
I am redoing my code and I came to the point that I need to replace line:

TapiRep = TapiRep & vbCrLf & "Command_formload " & CommandTail
with
Call SendData("Command_formload " & CommandTail)

Of course the part after TapiRep & vbCrLf & is not the same. Each line I
want to change has different parameters.
and I have over 400 lines of code to change!!!

Using Replace feature in visual basic I can replace:
TapiRep = TapiRep & vbCrLf &
with
Call SendData(

and there is not a problem with that.
The problem is with the ending bracket )
How can I add it to that automatically?
Can it be done?
Your thoughts please,
Jack


Larry Serflaten

2005-11-27, 9:55 pm


"Jack" <replyto@newsgroup> wrote
> I have this problem.
> I am redoing my code and I came to the point that I need to replace line:
>
> TapiRep = TapiRep & vbCrLf & "Command_formload " & CommandTail
> with
> Call SendData("Command_formload " & CommandTail)
>
> Of course the part after TapiRep & vbCrLf & is not the same. Each line I
> want to change has different parameters.
> and I have over 400 lines of code to change!!!

<...>
> The problem is with the ending bracket )
> How can I add it to that automatically?
> Can it be done?



How about spending 10 minutes and writing an app that will read the files
and do the replace for you?

LFS



Dave

2005-11-28, 6:55 pm

Jack

Or you could copy the code into Word (or similar) and use the more powerful
Finds&Replace there, also with Word you can alter it in stages without the
IDE complaining about syntax errors when you are half way through.

Dave O.

"Jack" <replyto@newsgroup> wrote in message
news:uMdCU$68FHA.2576@TK2MSFTNGP12.phx.gbl...
>I have this problem.
> I am redoing my code and I came to the point that I need to replace line:
>
> TapiRep = TapiRep & vbCrLf & "Command_formload " & CommandTail
> with
> Call SendData("Command_formload " & CommandTail)
>
> Of course the part after TapiRep & vbCrLf & is not the same. Each line I
> want to change has different parameters.
> and I have over 400 lines of code to change!!!
>
> Using Replace feature in visual basic I can replace:
> TapiRep = TapiRep & vbCrLf &
> with
> Call SendData(
>
> and there is not a problem with that.
> The problem is with the ending bracket )
> How can I add it to that automatically?
> Can it be done?
> Your thoughts please,
> Jack
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com