LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a better way to do the following with strings....

I am concatenating the string because it acts as a terminal, like tera term or putty.  And I force it to scroll as far to the bottom as possible.  I don't see anything necessarily wrong with this solution, but I wonder if there's a more elegant way.  Like... a right click setting change in the string indicator.

DailyDose_0-1674657002686.png

 

0 Kudos
Message 1 of 12
(1,534 Views)

I'm going to comment that (per the detailed help) setting that property to a negative number will set the scroll position to the bottom.  But other than that, that's what I do.  But I hope someone else has a more elegant solution.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 12
(1,528 Views)

I will chime in and also admit that is how I code it up as well.

I did not know about the -1 trick. Thanks for the tip. 👍

---------------------------------------------
Certified LabVIEW Developer (CLD)
0 Kudos
Message 3 of 12
(1,521 Views)

I didn't know that about the (-1) trick either.  Guess I should read the detailed help for all properties and not just some...

0 Kudos
Message 4 of 12
(1,512 Views)

@billko wrote:

I'm going to comment that (per the detailed help) setting that property to a negative number will set the scroll position to the bottom.  But other than that, that's what I do.  But I hope someone else has a more elegant solution.


So I guess this actually gets into a debate of what is elegant.  The input is an unsigned 32 bit.  So sure, a -1 for a signed 32 bit gives you exactly what I have unsigned.  So the question of elegance becomes - do we like coercion dots, or do we like big fat numbers?

Message 5 of 12
(1,505 Views)

@DailyDose wrote:

@billko wrote:

I'm going to comment that (per the detailed help) setting that property to a negative number will set the scroll position to the bottom.  But other than that, that's what I do.  But I hope someone else has a more elegant solution.


So I guess this actually gets into a debate of what is elegant.  The input is an unsigned 32 bit.  So sure, a -1 for a signed 32 bit gives you exactly what I have unsigned.  So the question of elegance becomes - do we like coercion dots, or do we like big fat numbers?


Ha! Good point.

---------------------------------------------
Certified LabVIEW Developer (CLD)
0 Kudos
Message 6 of 12
(1,487 Views)

@Frozen wrote:

@DailyDose wrote:

@billko wrote:

I'm going to comment that (per the detailed help) setting that property to a negative number will set the scroll position to the bottom.  But other than that, that's what I do.  But I hope someone else has a more elegant solution.


So I guess this actually gets into a debate of what is elegant.  The input is an unsigned 32 bit.  So sure, a -1 for a signed 32 bit gives you exactly what I have unsigned.  So the question of elegance becomes - do we like coercion dots, or do we like big fat numbers?


Ha! Good point.


I didn't notice the data type.  Nice.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 12
(1,469 Views)

@DailyDose wrote:

Like... a right click setting change in the string indicator.

 


If you mean a more elegant way to achieve the same automatic scrolling effect then no. You need to code the scrolling, and that's the simplest form of it.

 

If you mean improvements to the scrolling effect, sure it's possible. Whether it's worth the effort, or even an improvement, may depend on the application and your preferences.

 

If the user may be expected to try to scroll up and read something off the screen while data is coming in then it can be very annoying having the indicator jump back to the bottom all the time, so I often put in some way of disabling the scrolling.

 

One way to do this is to use the Mouse Enter and Mouse Leave events to toggle a boolean value that determines whether the scroll occurs. That way it doesn't move anytime the user is hovering over it.

 

Of course, you could also just use a button they can toggle.

0 Kudos
Message 8 of 12
(1,461 Views)

@DailyDose wrote:

I am concatenating the string because it acts as a terminal, like tera term or putty.  And I force it to scroll as far to the bottom as possible.  I don't see anything necessarily wrong with this solution, but I wonder if there's a more elegant way.  Like... a right click setting change in the string indicator.

DailyDose_0-1674657002686.png

 


The only thing I do differently for this situation is I keep the string in a shift register to avoid that Local Variable.  It probably doesn't matter.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 12
(1,438 Views)

@DailyDose wrote:

@billko wrote:

I'm going to comment that (per the detailed help) setting that property to a negative number will set the scroll position to the bottom.  But other than that, that's what I do.  But I hope someone else has a more elegant solution.


So I guess this actually gets into a debate of what is elegant.  The input is an unsigned 32 bit.  So sure, a -1 for a signed 32 bit gives you exactly what I have unsigned.  So the question of elegance becomes - do we like coercion dots, or do we like big fat numbers?


What is interesting about this is that somewhere in its history it must've been an i32 because I always right-click to make the constant, and U32 won't let you enter negative numbers.  Either that, or I just shrugged when it wouldn't let me enter a negative number and I changed it myself and forgot that part.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 12
(1,433 Views)