LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

show line numbers in string controls

Hello all,

 

I've got a small problem that seems to have no easy solution.

 

I need a string control that contains the line numbers. I'm afraid this option is not available ! Somebody has any idea ?

 

To give more details, we have developed an instrument (driven by LabVIEW) on which it is possible to store a script for some kind of automation. The script is an ASM-like text-based pseudo-code. I have, for example, jump operations but need to give the line number where the program has to jump ! It is quickly annoying to manually count the lines, not to mention the high risk of errors...

 

Iim currently running LabVIEW 2010. I've got the 2011 DVDs, but I'm a bit too lazy to install it for now. Just to mention that if a 2011-solution-only exists, it is welcome as well !

 

Any solution somebody ?

 

Thanks !

0 Kudos
Message 1 of 5
(3,011 Views)

You won't find any built-in solution for that. There is no built-in control for that. And before you ask, there is no built-in control like that for other programming environments (like Visual Studio) either. This is something you will need to program yourself. There have been example controls written around a RichTextBox, like this one: http://www.codeproject.com/KB/cpp/linenumbers%5Ffor%5Frtb.aspx. That example is a .NET control, so you could use it on the LabVIEW front panel. I have no idea how well it works, or how well it will work in a LabVIEW environment. 

0 Kudos
Message 2 of 5
(3,007 Views)

You can use this as a starting point for coding the desired functionality,

0 Kudos
Message 3 of 5
(2,987 Views)

I would probably consider using a Table as the starting point.  You can make the Row Headers visibile and simply write the row numbers to the headers.  Still requires some Event handling to gets things right, but most of the important functionality is taken care of for you such as scrolling and inserting and deleting rows.

0 Kudos
Message 4 of 5
(2,977 Views)

This functionality would be relatively simple to implement using an XControl.  Darin's table approach would be easiest to get the indentation of the wrapped lines correct (be careful not to put more into the table than is actually displayed or you may run into performance issues).  However, simply inserting a fixed field width line number at the beginning of each line would also work, especially if you lines do not normally wrap.  If you want to get total control, use a picture control as your base.

0 Kudos
Message 5 of 5
(2,949 Views)