EmEditor (text editor) Forum Index
   Questions and Answers about Macros
     GetLine Method get selected text only???
Register To Post

Flat Previous Topic | Next Topic
Poster Thread
Stefan
Posted on: 2/18/2012 10:56 am
Home away from home
Joined: 7/14/2008
From: Germany, EU
Posts: 265
GetLine Method get selected text only???
This is 11.0.5, 32-bit portable on XP SP3


Quote:
GetLine Method
Retrieves the text on the specified line.
[JavaScript] str = document.GetLine( yLine [, nFlags ] );
[VBScript] str = document.GetLine( yLine [, nFlags ] )


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.
FOR y = 1 to 3
  'Retrieves the text on the specified line.  
  str = document.GetLine( y )
NEXT


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:
FOR y = 1 to 3
  'Sets the cursor position.
  document.selection.SetActivePoint eePosLogical, 1, y, false

  'Selects a line at the cursor.
  document.selection.SelectLine

  'Retrieves the text on the specified line.  
  str = document.GetLine( y )
NEXT



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?
Flat Previous Topic | Next Topic


Subject Poster Date
 » GetLine Method get selected text only??? Stefan 2/18/2012 10:56 am
     Re: GetLine Method get selected text only??? Yutaka 2/20/2012 10:02 am
       Re: GetLine Method get selected text only! Stefan 2/20/2012 11:47 am

Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文