Click here to Skip to main content
15,912,021 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to replace text until end of the line? Pin
Luc Pattyn22-Jul-07 2:44
sitebuilderLuc Pattyn22-Jul-07 2:44 
GeneralRe: How to replace text until end of the line? Pin
sweehin1822-Jul-07 2:59
sweehin1822-Jul-07 2:59 
GeneralRe: How to replace text until end of the line? Pin
Luc Pattyn22-Jul-07 3:32
sitebuilderLuc Pattyn22-Jul-07 3:32 
GeneralRe: How to replace text until end of the line? Pin
sweehin1823-Jul-07 4:59
sweehin1823-Jul-07 4:59 
GeneralRe: How to replace text until end of the line? Pin
Luc Pattyn23-Jul-07 5:22
sitebuilderLuc Pattyn23-Jul-07 5:22 
GeneralRe: How to replace text until end of the line? Pin
Luc Pattyn23-Jul-07 5:23
sitebuilderLuc Pattyn23-Jul-07 5:23 
GeneralRe: How to replace text until end of the line? Pin
sweehin1823-Jul-07 9:16
sweehin1823-Jul-07 9:16 
GeneralRe: How to replace text until end of the line? Pin
Luc Pattyn23-Jul-07 9:36
sitebuilderLuc Pattyn23-Jul-07 9:36 
Hi,

several comments:

1.
please use the PRE tag to show some code, it preserves indentation, makes things
much more readable on this forum

2.
why does your code contain a dozen splitout(i) ?
it would be much better to use a variable to hold this, say
Dim split As String
split=splitout(i)
this improves readability inside your IDE as well as on this forum

3.
first bug: endMarkLen must equal the length of the thing that marks the end of what you search,
so you can skip it; it could be 1 or 2 (for length of vbCrLf), it certainly is NOT equal
to split.Length

4.
second bug: you search in the wrong order, you must look for V, then for second V,
then for the end-of-line; there is no other way that is guaranteed to work.
Actually looking for a second V only adds 2 lines to the program you had before !

5.
if things dont work as intended, you must search the bugs, that is called debugging.
Lots of people will tell you to use a debugger for that; I tell you to (temporarily) add
some output statements to your code, showing the content of your variables at different
locations in your code.
It may seem like a bit of extra work, the advantage is you get the relevant information
one after another, listed sequentially (as opposed to a debugger that lets you peek into
just everything, but makes it more diffictult to see many things at once, especially
values before and after something has happened.
Hence add "log statements" and study the log; in this case, show startIndex, endIndex,
etc. and check them manually.

6.
And always true: if something does not work as intended, and it seems difficult to manage,
trim it to something smaller that still fails, but is easier to analyze; then debug,
find the mistake, learn from it, and go back to the bigger thing.

Good luck





GeneralRe: How to replace text until end of the line? Pin
Luc Pattyn22-Jul-07 3:41
sitebuilderLuc Pattyn22-Jul-07 3:41 
GeneralRe: How to replace text until end of the line? Pin
sweehin1822-Jul-07 6:42
sweehin1822-Jul-07 6:42 
QuestionI have problem Pin
wayen22-Jul-07 1:53
wayen22-Jul-07 1:53 
AnswerRe: I have problem Pin
Sathesh Sakthivel22-Jul-07 4:07
Sathesh Sakthivel22-Jul-07 4:07 
GeneralRe: I have problem Pin
Paul Conrad22-Jul-07 5:38
professionalPaul Conrad22-Jul-07 5:38 
AnswerSearch and thou shall find Pin
Luc Pattyn22-Jul-07 9:51
sitebuilderLuc Pattyn22-Jul-07 9:51 
GeneralRe: Search and thou shall find Pin
Paul Conrad22-Jul-07 10:27
professionalPaul Conrad22-Jul-07 10:27 
JokeRe: Search and thou shall find Pin
Luc Pattyn22-Jul-07 10:46
sitebuilderLuc Pattyn22-Jul-07 10:46 
GeneralRe: Search and thou shall find Pin
Paul Conrad22-Jul-07 11:12
professionalPaul Conrad22-Jul-07 11:12 
GeneralRe: Search and thou shall find Pin
Sathesh Sakthivel22-Jul-07 15:58
Sathesh Sakthivel22-Jul-07 15:58 
QuestionTraffic Monitoring System Pin
Jshuwa21-Jul-07 16:39
Jshuwa21-Jul-07 16:39 
AnswerRe: Traffic Monitoring System Pin
Psycho-*Coder*-Extreme21-Jul-07 17:22
Psycho-*Coder*-Extreme21-Jul-07 17:22 
AnswerRe: Traffic Monitoring System Pin
Sathesh Sakthivel21-Jul-07 19:35
Sathesh Sakthivel21-Jul-07 19:35 
GeneralRe: Traffic Monitoring System Pin
Christian Graus22-Jul-07 10:23
protectorChristian Graus22-Jul-07 10:23 
AnswerRe: Traffic Monitoring System Pin
Christian Graus22-Jul-07 10:21
protectorChristian Graus22-Jul-07 10:21 
JokeRe: Traffic Monitoring System Pin
Luc Pattyn22-Jul-07 10:49
sitebuilderLuc Pattyn22-Jul-07 10:49 
GeneralRe: Traffic Monitoring System Pin
Christian Graus22-Jul-07 11:29
protectorChristian Graus22-Jul-07 11:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.