How to clear the contents of an app designer text area?

18 visualizzazioni (ultimi 30 giorni)
Leon
Leon il 17 Mar 2019
Modificato: Leon il 18 Mar 2019
Below is my code:
% --- create a file to store the QC comments ---
File1 = ['comments/QCcomments_' app.FileName.Value '.txt'];
fid = fopen(File1, 'at'); % append
fprintf(fid, '%s\n', ['Station No: ' num2str(app.StationNo.Value)]);
fprintf(fid, '%s\n', char(app.QCcomments.Value));
fprintf(fid, '%s\n', '');
fclose(fid);
What I want to do is to clear the app.QCcomments contents. I tried to use:
app.QCcomments.Value = ''
and it did not work.
Many thanks in advance!
  4 Commenti
Kojiro Saito
Kojiro Saito il 18 Mar 2019
So,
app.QCcomments.Value = '';
should clear the text area. Is there any error message?
Leon
Leon il 18 Mar 2019
Modificato: Leon il 18 Mar 2019
Working now.
For some reason, it did not work last time I tried it. Sorry about that.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by