Comment out "eventdata" with "~" in GUI

3 ビュー (過去 30 日間)
Douglas Anderson
Douglas Anderson 2013 年 11 月 22 日
回答済み: Image Analyst 2013 年 11 月 22 日
guide suggests replacing "eventdata" in callbacks with "~"; is this wise? If I don't do it, M-lint will always show orange!
Thanks.
Doug

採用された回答

Image Analyst
Image Analyst 2013 年 11 月 22 日
You can, but you'll still have another orange squiggle on the line. It will still say that the callback function might not be used. Duh! It's a callback, and won't get used unless someone interacts with the control it's associated with. You can suppress warnings, but I didn't suppress that warning because what if there is some dead code function somewhere in your code that you custom wrote (not a built-in callback generated from GUIDE)? I'd like to know about those unused functions. However I have so many of these callbacks that my right margin is just a virtual barcode of orange and gray stripes, so I tend to ignore them on the margin.
If it's in the code window (text editor) and it's a valid suggestion, then I will take corrective action, but I ignore most on the right panel because there are simply too many.

その他の回答 (1 件)

Vishal Rane
Vishal Rane 2013 年 11 月 22 日
You can if you are not using that variable in rest of the function. The '~' doesn't work in the older versions though( R2006b or R2007a, i believe, will chk and edit this).

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by