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

14 views (last 30 days)
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 Comments
Kojiro Saito
Kojiro Saito on 18 Mar 2019
So,
app.QCcomments.Value = '';
should clear the text area. Is there any error message?
Leon
Leon on 18 Mar 2019
Edited: Leon on 18 Mar 2019
Working now.
For some reason, it did not work last time I tried it. Sorry about that.

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!