Always prepend "app" to shared variable in App Designer?

1 回表示 (過去 30 日間)
Douglas Anderson
Douglas Anderson 2019 年 9 月 10 日
コメント済み: Douglas Anderson 2019 年 9 月 10 日
Hello,
I have set a variable in "Properties" to share it between functions. Works fine, but I get a zillion warnings.
I have used GUIDE before, and used handles.variable_name to share a variable between functions within the app. There I will make handles.variable_name = variable_name; in one function. In another function I will then say variable_name = handles.variable_name, and don't get warnings that I should prepend "handles." everytime I write variable_name.
Is this a bug or feature of App Designer?
Thanks!
Doug

採用された回答

Steven Lord
Steven Lord 2019 年 9 月 10 日
If by "warnings" you mean the orange underlines of that section of your code, neither. It is a feature not of App Designer but of Code Analyzer, who's warning you that you may have meant to reference the object property but instead are creating / referencing a local variable by that name (which may or may not exist.) It's trying to alert you to a pattern that looks like a potential bug in your code.
See the "Adjust Code Analyzer Message Indicators and Messages" section on the documentation page linked above for different ways to suppress that message if you understand its purpose and know you can safely ignore it.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by