? for string, inserting a vbcrlf every N characters, or improving the behavior of MSXML

K

Ken Fine

I'm using ASP VB. I want to insert a VbCr or a VbLf into a declared string
every N characters. FWIW, I want to do this because of an apparent
limitation in MSXML2, which I am using to "scrape" data from webpages that I
control: I'm getting spurious exclamation points (!) where line lengths are
too long. Manually inserting line breaks (which do not render in HTML) seems
to solve the problem.

If I cannot figure out what's wrong with MSXML (or however I'm misapplying
it in my app), I need to flesh out the following pseudocode:

Dim myString, myCursorPosition, myIncrement
myString ="The quick brown fox jumped over the lazy dog."
myCurrentCursorPosition=0
myIncrement=5 ' I want a line break for every myIncrement

While [there are still remaining characters to walk through in the string
' navigate cursor by myIncrement through myString
...
' insert a VbLf at myCurrentCursorPosition
...
myCurrentCursorPosition = myCurrentCursorPosition + myIncrement
[loop]

Thanks for any help on the syntax here, or on an MSXML fix.

-KF
 
A

Anthony Jones

Ken Fine said:
I'm using ASP VB. I want to insert a VbCr or a VbLf into a declared string
every N characters. FWIW, I want to do this because of an apparent
limitation in MSXML2, which I am using to "scrape" data from webpages that I
control: I'm getting spurious exclamation points (!) where line lengths are
too long. Manually inserting line breaks (which do not render in HTML) seems
to solve the problem.

If I cannot figure out what's wrong with MSXML (or however I'm misapplying
it in my app), I need to flesh out the following pseudocode:

Dim myString, myCursorPosition, myIncrement
myString ="The quick brown fox jumped over the lazy dog."
myCurrentCursorPosition=0
myIncrement=5 ' I want a line break for every myIncrement

While [there are still remaining characters to walk through in the string
' navigate cursor by myIncrement through myString
...
' insert a VbLf at myCurrentCursorPosition
...
myCurrentCursorPosition = myCurrentCursorPosition + myIncrement
[loop]

Thanks for any help on the syntax here, or on an MSXML fix.

Try getting your problem with MSXML resolved by posting a more detailed
description of the problem you are having with it to the
microsoft.public.xml group. We'll try to help you out there.

I know of no limitiation with regard to MSXML and line lengths. XML doesn't
even have a concept of lines and like HTML is pretty much blind to them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top