Output absolute value of cursor position?

Started by 999hippo, August 15, 2013, 06:14:38 PM

Previous topic - Next topic

999hippo

Hi.

to output cursor position (line/row) I find:

     output.writeln(ActiveView.Position.Line + " " + ActiveView.Position.pos);

But I really need just the ABSOLUTE value. Is this possible?

alex

Code (javascript) Select
var pos = ActiveDocument.TextToAbsolute(ActiveView.Position);

there is some other functions of document you may need:

[id(44), helpstring("Convert Text Position to Absolute Position")] HRESULT TextToAbsolute([in] IPosition* pPosition, [out, retval] POS_T *pnAbsolute);
[id(45), helpstring("Convert Absolute Position to Text Position")] HRESULT AbsoluteToText([in] POS_T nAbsolute, [out, retval] IPosition** ppPosition);
[id(50), helpstring("Calculate absolute distance between text positions")] HRESULT AbsoluteDistance([in] IPosition* pStart, [in] IPosition* pEnd, [in, optional, defaultvalue(eCRLFStyleAuto)] eCRLFStyle nLBStyle, [out, retval] POS_T *pnAbsolute);

HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

999hippo

Awesome. I have another question, but will post to new thread - as I think it is probably more helpful to others.

Thanks so much for the quick reply!