Does somebody know how can I code a line which identifies if the code isn't currently available?
For example: if I wrote a code that says: launch URL "skype://" , if the command isn't available because there is no Skype application installed on the iPhone, so another command will be sent.
try
--your code that tries to launch Skype
catch someError
--your alternative code that you call only if Skype isn't available
end try
Although it would be more elegant to have some way of checking for an iPhone's installed apps and whether the user is currently logged in to Skype - but I have no idea how to do that whilst your app is sandboxed)
...
When launch url is called, LiveCode checks to see if an application is available to handle the URL.
If no such application exists, the command returns "no association" in the result.
...
Hi Klaus - yeah you are right however I find I can't always be sure what value the result will have (cf 'it') and I often need to confirm what it SHOULD be (below is an extract from the dictionary):
Many commands (such as go and find) set the value of the result function when they finish. In most cases, if the result is empty, the command was successful; if the result is not empty, the command failed and the result contains an error message. See the specific command for information about whether it sets the result function.
Do you have a simple rule-of-thumb I can use to remind myself what the result is expected to be in common situations?