EmEditor (text editor) Forum Index Questions and Answers about Macros
GetLine Method get selected text only??? | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| Stefan | Posted on: 2/18/2012 10:56 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 261 |
GetLine Method get selected text only??? This is 11.0.5, 32-bit portable on XP SP3
Quote: GetLine Method But i wonder why GetLine returns the selected part only instead of the whole line? Back ground: in an macro i walk through all selected lines and wanted to get the text of the WHOLE line. Instead i get the selected part of that lines only. Why? How can i get the whole line at easy? Do i really have to use something like: Question: Can GetLine() be extended by an flag to get the whole line always, no matter of the selection? If not, should the help wrote "Retrieves the selected text on the specified line." instead of "Retrieves the text on the specified line." Or is there an other method? |
| Yutaka | Posted on: 2/20/2012 10:02 am |
Webmaster ![]() ![]() Joined: 9/28/2006 From: Redmond Posts: 2398 |
Re: GetLine Method get selected text only??? Hello,
I couldn't reproduce this issue. Can you show me or send me a sample file? Can you write how the file was selected when you run this macro? Thank you,
|
| Stefan | Posted on: 2/20/2012 11:47 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 261 |
Re: GetLine Method get selected text only! Your answer implies that GetLine() returns the whole line already.
That was not clear to me because i saw different results (to my failure as i see now) Today i saw by an another test that GetLine() returns the whole line indeed: Now that i know that GetLine() returns the whole line content i know i did something wrong. My problem was that i wanted not to select the whole lines (in front of executing my script) but start selection at some signs behind SOL at first line and end at some position before EOL at the last line. BUT then, silly me, i used document.selection.Text = newtext and was wondering why GetLine() didn't returns the whole line, now i see i was to silly to get what happens... sorry. (only the selected text was altered, of course) No i use something like The additional document.selection.SelectLine extends at real time the selection to the whole line and so my replacement replaces the whole line as wanted. Issue solved. Thanks Yutaka! Thank you for your endurance and support! |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |




