09-10-2012 01:13 PM
@smercurio_fc wrote:
[...]
If you're doing a loop then you can apply the same method to change the color by word.
You beat me to it, but I reset the color of the existing text before reading your post.
I modified it and got an unexpected result:
09-10-2012 01:31 PM - edited 09-10-2012 01:32 PM
For two arbitrary strings and two arbitrary colors concatenated an arbitrary number of times you could do something like the attached. (Didn't put too much thought into it, so it's probably a bit "rube-ish")
09-11-2012 04:04 AM
Don't think you quite get what I am asking for, in your example you are making it all one colour at the end, totally not what i was after.
I have attached something more accurate, you can see what i am trying to get in the expected string and what i am actually getting
09-11-2012 04:18 AM
Smercurio_fc
Sorry let me try make it a little clearer cause I've played with what you sent and its not quite right.
Firstly its a while loop (dunno if that will affect anything), maybe its fine either BUT the big mean dog could change on the fly
One loop it could have Hello as a write in red followed by Hi
The next loop round it could have How are you? as a write and fine, you? as a read
Your example works if the text remains the same, but if i put String X and Y in the loop (with a while at the end so i can make changes to the text in between loops then ok it on) and the type what i type above, it loses the color formatting
09-11-2012 04:38 AM
(Timed out on edit, wanted to tidy that up a bit and try add more clarification)
Smercurio_fc
Sorry let me try make it a little clearer cause I've played with what you sent and its not quite right.
Firstly its a while loop (dunno if that will affect anything), maybe its fine either way BUT the big mean dog could change on the fly
One loop it could have Hello as a write followed by Hi
The next loop round it could have How are you? as a write and fine as a read
Since as i am monitoring a comms port I might get several reads without sending a write, in which case I want all the read text to be blue, so i might get something like:
Hello Hi How are you? fine *comms go quiet for a bit* So it was a bit warm today
Your example works if the text remains the same, but if i put String X and Y in the loop (with a while at the end so i can make changes to the text in between loops then ok it on) and then type what i type above, it loses the color formatting
Thanks for the attempt you got a lot closer than I did =p
Hopefully you'll know a how to get it this way
09-11-2012 05:44 AM
09-11-2012 07:40 AM
@NIcurious wrote:
(Timed out on edit, wanted to tidy that up a bit and try add more clarification)
Smercurio_fc
Sorry let me try make it a little clearer cause I've played with what you sent and its not quite right.
Firstly its a while loop (dunno if that will affect anything), maybe its fine either way BUT the big mean dog could change on the fly
One loop it could have Hello as a write followed by Hi
The next loop round it could have How are you? as a write and fine as a read
Since as i am monitoring a comms port I might get several reads without sending a write, in which case I want all the read text to be blue, so i might get something like:
Hello Hi How are you? fine *comms go quiet for a bit* So it was a bit warm today
Your example works if the text remains the same, but if i put String X and Y in the loop (with a while at the end so i can make changes to the text in between loops then ok it on) and then type what i type above, it loses the color formatting
Thanks for the attempt you got a lot closer than I did =p
Hopefully you'll know a how to get it this way
Ah, that changes the requirement considerably. What you're talking about has been asked about before. I remember someone asking about a "colorized Hyperterminal-like" VI, or something like that. Numerous suggestions were posted, like keeping track of the bits of strings that were added (along with the the colors), using a Listbox rather than a string, and even using a picture control instead of a string control since it's easy to add colorized text to a picture control.
09-11-2012 08:12 AM
Will try yours now jcarmody, just i have a lot of places where i concatenate, gonna take a while to implement it this way, will give it a go and let you know what happens
Thanks for the suggestion
09-11-2012 08:36 AM
I think this does work but it looks like it goes over all the text byte at a time and selects the color it previously was, I just worry this will take too much memory to sustain as the run time increases?
09-11-2012 10:27 AM
This does seem to grind my VI to a halt pretty quickly 😞