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