LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you append data to a text box using SetCtrlVal()?

The SetCtrlVal() function panel help says:

"When you call SetCtrlVal on a text box, SetCtrlVal appends value to the contents of the text box. Use ResetTextBox to replace the contents of the text box with value."

Everytime I use SetCtrlVal() it replaces the contents of the text box rather than appending as the help suggests.

Have I misinterpeted the help?
0 Kudos
Message 1 of 5
(5,929 Views)
You have correctly interpreted the help. It may happen that the new text entered moves old contents of the text box out of the viewable area, so that it seems that old text has been replaced. Try enlarging the text box or retrieving its value in a string and look at the string.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(5,929 Views)
Also, make sure you're using a text box and not a string. SetCtrlVal on a string replaces the string.
0 Kudos
Message 3 of 5
(5,929 Views)
Thanks, I see the problem now. "Box" is the key word in the help.

There are 3 kinds of Text Controls.
String, Text Label and Text Box.

The Append only works with the Text Box, I was trying to use a Text Label.
0 Kudos
Message 4 of 5
(5,929 Views)
If you need to do an append to a label, first call GetCtrlVal, then strcat your new data to append, then call SetCtrlVal.
0 Kudos
Message 5 of 5
(5,929 Views)