LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scroll to byte position on a String Control

Hello,

I have a very large String Control for editing any text. With two numeric controls I can set begin and end of marking. Now I want, that String Control scroll automatically to begin of new marking. I could only find a property to set the line position ('Text.ScrollPos') but I need one to set the byte position (same like marking properties). Has anybody an idea for solution?

Thank you
C. Dietz
Christian

Test Engineering
digades GmbH
www.digades.com
0 Kudos
Message 1 of 5
(2,952 Views)
C. Dietz!
The position inside the control of the selection start will be dependent on the string control's width, font size and contents (line feeds etc).
You could always copy the selected portion to another control, or to the same control, dynamically at runtime.
 
/Vedeja
0 Kudos
Message 2 of 5
(2,938 Views)
hi,
pls find attached useful as a reference 🙂
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 5
(2,920 Views)

C. Dietz

I have another approach. I suggest that you search for your marker (I have chosen 999) using match pattern and count how many lines forward you are and set the scroll position accordingly like this

I have attached the example in version 7.0. It only does a forward search for 999 and terminates when it can't find any more.

Maybe you can use this and adapt it to your needs.

David

Message Edited by David Crawford on 05-22-2006 04:27 PM

Download All
0 Kudos
Message 4 of 5
(2,920 Views)
Hello together,

thank you for all replies. Sometimes my etiting strings are very long (e.g. over 300000 characters) so that much calculating in VI not convenient. But your methods of resolution brought me to the follow resolution:

1. Retrieve the number of bytes on first line of String via Methode Node. This number is the parameter Bytes Per Line.
2. Divide the Byte Number I want to jump trough this parameter and getting the line to activate via Property Node.

Kind regards
C. Dietz
Christian

Test Engineering
digades GmbH
www.digades.com
0 Kudos
Message 5 of 5
(2,896 Views)