Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE innertext with CRLF

Status
Not open for further replies.

thegame8311

Technical User
Jan 6, 2012
133
US
I was wondering if the following code could be alter to make sure it has the carriage returns and line feeds

Code:
oIE = createobject('internetexplorer.application')
oIE.Navigate('[URL unfurl="true"]www.tek-tips.com')[/URL]
lcStr=oIe.Document.body.innertext
?lcStr
 
Not sure what you are asking. What do you mean "it has the carriage returns and line feeds"?

Do you want to check to see if there are CRLFs in the text? And, if so, are you looking for actual ASCII CR and LF characters? Or HTML? Or hex codes? Or what?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Well what I mean is that currently the code seems to take out CRLF, I want a way to keep those in and still have the innertext.

so in a nutshell I want to check the html for CRLF, because I don't see that there are any using the innertext

I can try to explain it better if there is still confusion
 
Browsers strip off CRLF, unless you have them in <pre></pre> tags, that's true.

The only way to get at the source including line feeds is to read the innerhtml proeprty instead. But even that might not keep all the line feeds.

Mostly, text isn't preformatted but continuous text and it just depends on the browser dimensions/resizing how the text is shown.

Does this somehow relate to your word counting in the fwrite thread? What are you trying to achieve?

Bye, Olaf.
 
ok, that makes sense and it does help with my word count issue, maybe I can make it work, the way I want
 
ok, so now I need to have a new line for every entry, but instead of that I get the actual character for CRLF, is there a newline character?
 
Don't know what you mean by "I get the actual chracter for CRLF". And if so, isn't that what you wanted? And why do you ask "is there a newline character", if you say there is?

I don't know what you want to know now. So I can only chunk out all you need to know about line feeds:
1. in ascii text files in windows you have CRLF in 2 chars CR and LF, CR stands for ascii code 13 LF for ascii code 10.
2. in ascii text files in linux you have LF only typical as linefeed.
So depending on the source of the html file or script you navigate to you can have one or the other, but:
3. browser really don't care for these, they display text formatted via the markup (html = hyper text markup language), which means marking passages of text with html tags as heading (eg h1,h2...), paragraph (p), etc. I may bore you with things you already know. In html there are several tags that lead to linefeeds: br, p, hn (headings), li (list items), tr (table row), etc etc... It's quite endless and will not only depend on the tags but also on CSS definitions loaded.

Lines within paragraphs have NO linefeed char, but just occur due to the browser size. The browser does automatic line breaking at full words with a best fit. You will never get lines from neither the.innertext nor .innerhtml properties. Even in the document object model the IE uses for the structural information about the html page there is no concept of lines or paes, there is just the concept of divs, headings, paragraphs and all is one page.

You're trying to force something upon the html page which isn't in there, nobody can help you with it.

So again asked: What do you really want to achive on the highest level, take a huge step back and tell us what you want to do overall with your code.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top