Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Auto Save and Load Text
ADOXtra Lite
Pauseable Timer with Progress Bar
Buddy Tray
ScreenCapture
myBackGround
Royalty free Music and Loops
Export Text for proofing
Centipede
Datagrip Net
 

 

 

Behavior Get Visual Line Count and Current Visual Line of Insertion

Added on 5/6/2005

 

Compatibilities:
D8 D8_5 D9

This item has not yet been rated

Author: Chunick (website)

Due to text wrapping you cannot get the visual line you click on unless 'hard returns' are used after each line. Following are two functions that will return the total number of visual lines and the visual line that the insertion carat is currently on, respectively. The last can be modified to return the line under the mouse cursor.

on getLineCount (theMem)
theMemHeight = theMem.height
theLineCount = theMem.locVtoLinePos(theMemHeight)
return theLineCount
end

on getInsertionLine (theMem)
theSelect = theMem.selection
theLoc = theMem.CharPosToLoc(vSelect[1] + 1)
theLine = theMem.LocVToLinePos(vLoc.locV)
return vLine
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail