Edit Control in a GUI

1 Ansicht (letzte 30 Tage)
Robert
Robert am 26 Okt. 2013
Kommentiert: Robert am 31 Okt. 2013
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 Kommentare
Walter Roberson
Walter Roberson am 26 Okt. 2013
Interesting. Is the non-printing character always the same one? What is its corresponding numeric value?
Image Analyst
Image Analyst am 27 Okt. 2013
What release of MATLAB?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Robert
Robert am 27 Okt. 2013
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 Kommentare
Walter Roberson
Walter Roberson am 27 Okt. 2013
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 am 31 Okt. 2013
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by