Re: Determining a scroll based on code unit offsets

2020-03-27 Thread J. Landman Gay via use-livecode
Hm. My handler fails too on larger offsets but I think it's because there are lines above it that have spaceAbove and spaceBelow attributes, and those aren't being taken into consideration when multiplying lines by the textheight. I think Mark's example might work if formattedHeight adjusted for

Re: Determining a scroll based on code unit offsets

2020-03-27 Thread J. Landman Gay via use-livecode
Oops. Not saved. It fails on larger offsets. Maybe I'm doing something wrong. Here's my longer way, it could likely be optimized better. It does rely on a scripted field selection, and the selectedChunk is passed to the handler: on grpScroll pSelChunk -- pSelChunk = selected field chunk: char

Re: Determining a scroll based on code unit offsets

2020-03-27 Thread Bob Sneidar via use-livecode
If someone can come up with a name for the function I’ll post it. Bob S On Mar 27, 2020, at 1:49 PM, Bob Sneidar via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: That needs to be turned into a function and added to the MasterLibrary! (If it works…) Bob S __

Re: Determining a scroll based on code unit offsets

2020-03-27 Thread J. Landman Gay via use-livecode
Saved again! I should have thought of that. Thank you. I had just worked out a handler that did the same thing in way too many lines. On 3/27/20 2:47 PM, Mark Waddingham via use-livecode wrote: Maybe (the formattedHeight of codeunit 1 to OFFSET of FIELD - the formattedHeight of codeunit OFFSET

Re: Determining a scroll based on code unit offsets

2020-03-27 Thread Bob Sneidar via use-livecode
That needs to be turned into a function and added to the MasterLibrary! (If it works…) Bob S On Mar 27, 2020, at 12:47 PM, Mark Waddingham via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: Maybe (the formattedHeight of codeunit 1 to OFFSET of FIELD - the formattedHeight of codeu

Re: Determining a scroll based on code unit offsets

2020-03-27 Thread Mark Waddingham via use-livecode
Maybe (the formattedHeight of codeunit 1 to OFFSET of FIELD - the formattedHeight of codeunit OFFSET of FIELD)? Sent from my iPhone > On 27 Mar 2020, at 17:59, J. Landman Gay via use-livecode > wrote: > > In our last episode, our heroine was trapped by the selection of a line > containing m

Re: Determining a scroll based on code unit offsets

2020-03-27 Thread J. Landman Gay via use-livecode
I thought of that, but I only have access to a line number based on paragraphs. On 3/27/20 1:01 PM, Bob Sneidar via use-livecode wrote: There is a formattedHeight On Mar 27, 2020, at 11:00 AM, Bob Sneidar mailto:bobsnei...@iotecdigital.com>> wrote: is there a formattedTextHeight? Bob S On

Re: Determining a scroll based on code unit offsets

2020-03-27 Thread Bob Sneidar via use-livecode
There is a formattedHeight On Mar 27, 2020, at 11:00 AM, Bob Sneidar mailto:bobsnei...@iotecdigital.com>> wrote: is there a formattedTextHeight? Bob S On Mar 27, 2020, at 10:58 AM, J. Landman Gay via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: 1,103,7 While 7 is a line numb

Re: Determining a scroll based on code unit offsets

2020-03-27 Thread Bob Sneidar via use-livecode
is there a formattedTextHeight? Bob S On Mar 27, 2020, at 10:58 AM, J. Landman Gay via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: 1,103,7 While 7 is a line number, multiplying that by the textheight doesn't give consistent results due to line wrap. The first two items are cod

Determining a scroll based on code unit offsets

2020-03-27 Thread J. Landman Gay via use-livecode
In our last episode, our heroine was trapped by the selection of a line containing metadata. The heroes of this group saved her. In all cases, scrolling the field was accomplished by using the "select" command to bring the line into view. Alas, escape from one danger has led to another. The fi