Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search


 [1/2] from: hijim::pronet::net at: 13-Aug-2001 19:04

my-lines/text: length? my-area/line-list That statement gives me the number of lines in my file, which is nice to know -- especially for printing.. I'm wondering if anyone knows how to find out the line number the cursor is on. I've tried a couple of things and managed to freeze the screen with no exit. REBOL gives the line number where an error has occurred. I'd like to be able to identify the line I'm on in a text area. Thanks, Jim

 [2/2] from: arolls:bigpond:au at: 14-Aug-2001 13:00

I am not sure, but you should look into: probe first system/view where you can find the line-info object. probe first system/view/line-info It looks to me like you can find the pixel coordinates of the cursor here (at least the y part): view layout [a: area] ; type some text system/view/line-info/offset == 2x47 ; eg. this was on the fourth line from the top system/view/caret ; index of the text system/view/line-info/start ; start of the current line