Edit Control in a GUI

1 次查看(过去 30 天)
Robert
Robert 2013-10-26
评论: Robert 2013-10-31
If the contents end in a backslash (text entered using the Property Inspector) the result has a non-printing character added at execution and are therfore not correct if I want to use the value. If I change the contents of the Edit Control during execution, the contents are correct.
  2 个评论
Walter Roberson
Walter Roberson 2013-10-26
Interesting. Is the non-printing character always the same one? What is its corresponding numeric value?
Image Analyst
Image Analyst 2013-10-27
What release of MATLAB?

请先登录,再进行评论。

采纳的回答

Robert
Robert 2013-10-27
Running Matlab 2012b on a Windows 7 64 bit system. I do not know if the nonprinting character is the same since I have not be able to observe it. I know it is there because when I go to the property Inspector to change the Edit Box information I have to use the backspace key twice to delete the last character. Also I send the String from the Edit Box to the Screen. The result is displayed as a n character value [1 x n] where n is at least one more than the number of characters in the Edit Box. It there is no back slash at the end of the entry in the Edit Box, then the correct string is displayed on the screen.
  2 个评论
Walter Roberson
Walter Roberson 2013-10-27
get() teh String property, and add numeric 0 to the string. The result will be a numeric array that will show the character numbers of each character.
Robert
Robert 2013-10-31
Thanks. I managed to make the problem go away by clearing the Edit box string in the Property Inspector and saving.. Then running with an empty String. Then I used the Propeerty Inspector to insert a String. It now works fine. No good explanation. Thanks for your hint.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by