Edit Control in a GUI

2 vues (au cours des 30 derniers jours)
Robert
Robert le 26 Oct 2013
Commenté : Robert le 31 Oct 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 commentaires
Walter Roberson
Walter Roberson le 26 Oct 2013
Interesting. Is the non-printing character always the same one? What is its corresponding numeric value?
Image Analyst
Image Analyst le 27 Oct 2013
What release of MATLAB?

Connectez-vous pour commenter.

Réponse acceptée

Robert
Robert le 27 Oct 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 commentaires
Walter Roberson
Walter Roberson le 27 Oct 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 le 31 Oct 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by