Author Topic: Output absolute value of cursor position?  (Read 1592 times)

Offline 999hippo

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Output absolute value of cursor position?
« on: August 15, 2013, 05:14:38 pm »
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?

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2181
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Output absolute value of cursor position?
« Reply #1 on: August 15, 2013, 09:42:42 pm »
Code: Javascript
  1. var pos = ActiveDocument.TextToAbsolute(ActiveView.Position);

there is some other functions of document you may need:
Code: [Select]
[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);

Offline 999hippo

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Output absolute value of cursor position?
« Reply #2 on: August 16, 2013, 02:33:46 am »
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!

 

Related Topics

  Subject / Started by Replies Last post
15 Replies
7111 Views
Last post April 28, 2009, 12:25:01 am
by alex
1 Replies
2470 Views
Last post April 18, 2009, 09:19:53 pm
by alex
2 Replies
2187 Views
Last post April 11, 2010, 01:21:38 am
by alex
9 Replies
2963 Views
Last post July 05, 2012, 08:57:16 pm
by SFdude
1 Replies
1210 Views
Last post November 16, 2014, 11:30:08 pm
by alex