ā01-09-2009 05:03 PM
ā01-09-2009 05:18 PM
And you don't want to use the event structure because?...
Alternative: Use a loop. Poll the string length in the loop. If >205, chop off the extra characters and write back to the string control. Make sure the string's "Update value while typing" is set. Sloppy, but it works. Without an event structure.
ā01-10-2009 10:55 AM - edited ā01-10-2009 10:57 AM
WSalas wrote:I do not want to use the Event structure
Why not? This sounds like the perfect application for an event structure.
ā01-10-2009 01:34 PM
ā01-10-2009 02:03 PM
GerdW wrote:Hi Cory,
instead of Text.Text property you can use the "Value" property too - one menu less and IMHO more intuitive
Hehe, yeh. Whatever saves a click or two
.
ā01-10-2009 09:01 PM - edited ā01-10-2009 09:05 PM
Cory and GerdW,
if you need to save clicks, use a local variable and forget about the case structure. š š

ā01-11-2009 12:03 AM
chilly charly wrote:use a local variable
People on the forums tend to get mad when local variables are used.
So for the sake of not getting yelled at, we'll stick with the case structure
ā01-11-2009 09:10 AM
Cory K wrote:
chilly charly wrote:use a local variable
People on the forums tend to get mad when local variables are used.
No, people on the forums tend to get mad when local variables are abused. Big difference. ![]()
ā01-11-2009 10:22 AM - edited ā01-11-2009 10:24 AM
Cory K wrote:
chilly charly wrote:use a local variable
People on the forums tend to get mad when local variables are used.
So for the sake of not getting yelled at, we'll stick with the case structure
But in your code, you are essentially using a local variable. Actually, it's a bit worse, it's a property node and a little bit more obscure one that.
If you are trying to change a value that is part of a control (an object that is a source of data in a block diagram) you have to use either a local variable or a property node to be able to update/correct it.
The use of the case structure has nothing to do with the use of the property node or local variable.
ā01-11-2009 05:43 PM
Instead of trimming the oversized string after the fact, simply use a filtering event and discard key entries if the size is already met. Make sure to still allow editing keys to function.
This problem has been discussed last summer, so modify my example from back then. All you need to do is change one diagram constant. š