LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

limitations of TextBox

Hello again
I have a customer, who used a textBox in his program to display (error)-messages. When the program runns several hours, it seems that the program slowes down.
I had a look at the code and noticed, that he always added lines to the text box, but never deletes a lines. So, during a run for several hours, the text box filled up with some hundred lines of text.
I gues, that the slow down may come from the text box, because of the many lines of text in the text box. I think, that the box must reallocate new memory, when text is added to it, and so the memory get more and more fragmented, which will slow down the hole program.
Is this a possible reason?
What limits for text len does a text box have?

Thanks

Stepan
0 Kudos
Message 1 of 2
(2,967 Views)
Hello stephan,
The text box may indeed need to reallocate additional memory if you keep inserting lines without deleting any. I would recommend experimenting by disabling the text box and see if you program still experiences a slowdown (if it does not, then you have found the source). You could delete lines one at a time using DeleteTextBoxLine(), however it might be more efficient to call DeleteTextBoxLines() (plural) to delete multiple lines every time you write some predetermined number of lines. Starting with CVI 5.5, the Text Box by default supports an unlimited number of lines. You can change this by setting the new Text Box attribute ATTR_EXTRA_LINES. Please try these recommendations and let us know if you have further questions.

Jeremiah Cox
Applications En
gineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(2,967 Views)