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

9 ビュー (過去 30 日間)
Leon
Leon 2019 年 3 月 17 日
編集済み: Leon 2019 年 3 月 18 日
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 件のコメント
Kojiro Saito
Kojiro Saito 2019 年 3 月 18 日
So,
app.QCcomments.Value = '';
should clear the text area. Is there any error message?
Leon
Leon 2019 年 3 月 18 日
編集済み: Leon 2019 年 3 月 18 日
Working now.
For some reason, it did not work last time I tried it. Sorry about that.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by