01-25-2023 08:30 AM
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.
01-25-2023 08:40 AM
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.
01-25-2023 08:42 AM
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. 👍
01-25-2023 08:56 AM
I didn't know that about the (-1) trick either. Guess I should read the detailed help for all properties and not just some...
01-25-2023 09:04 AM
@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?
01-25-2023 09:36 AM
@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.
01-25-2023 10:17 AM
@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.
01-25-2023 10:28 AM
@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.
01-25-2023 10:31 AM
@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.
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.
01-25-2023 10:35 AM
@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.