info on how to check the availability of the API function

This commit is contained in:
Evgeny
2022-07-30 15:18:56 +03:00
parent 1a8e864e59
commit 1183ec7bb9
2 changed files with 18 additions and 0 deletions

View File

@@ -532,6 +532,17 @@ For example, let's say you want to use the `weather` module that appeared in ver
-- aio_version = "4.1.3"
```
You can also check the presence of a particular API function this way (note the use of a dot instead of a colon):
```
if ui.show_list_dialog then
ui:show_text("list dialog supported")
else
ui:show_text("list dialog is not supported")
end
```
# Debugging
Some tips on writing and debugging scripts:

View File

@@ -0,0 +1,7 @@
function on_resume()
if ui.show_list_dialog then
ui:show_text("list dialog supported")
else
ui:show_text("list dialog is not supported")
end
end