Ru | En
Drakon.Tech supports await expressions. The await keyword is only allowed in async functions.
How to make a function async in Drakon.Tech
- Right-click on the function header.
- Choose "Properties."
- Set function type to "Async function."
In Drakon.Tech, async functions are state machines that can accept messages. In other words, async functions in DrakonTech allow for automata-based programming. However, you don't need to think about that unless you intend to send information to long-running functions.
How to catch exceptions in async functions
Drakon.Tech does not allow the try-catch construct in async functions. To catch exceptions in an async function, use the on error goto X expression.
- Transform an async function into a silhouette.
- Choose a branch for error handling.
- Right-click on the diagram header and choose "Properties."
- Add this line to the parameters: on error goto BranchName.
To get a reference to the error object in the handler branch, use getHandlerData() function.