The way my try statements work are as follows:
1. Try to parse code until "catch" keyword.
2. If an error occurs before "catch", stop parsing and skip to catch code.
3. If an error does not occur, skip catch code.
4. Parse until caught.
An example would be:
method test try @var = 123.456789 @var = "This will cause a conversion error." say "This will never be seen as an error already occurred." catch @e = last_error say "An error occurred: ${@e}" caught say "try-catch-caught may be used as many times as necessary." end testProduces: An error occurred: conversion_error:@a
If an error does not occur, the catch code will not be parsed. If an error does occur, parsing stops and USL automatically starts parsing the catch code until all is caught. The caught keyword closes the try statement. You may use try-catch-caught as many times as is needed. Other languages exit the method/function after try-catch statements. So that is another unique feature of USL that distinguishes it among other languages.
I've updated the MediaWiki and you can find it under the "Hosted Apps" tab at the sourceforge link below.
To download 3.7.0, you can visit any of the following links:
sourceforge
freecode
No comments:
Post a Comment