Exception Handling |
|
Exceptions are handled by try/catch/throw as known by C++ and JAVA: foo() { try { .... var exc = { 'error in foo:', 'the message' }; throw exc; .... } // try catch (const xx[]) { for (var i = 0; i < sizeof xx; i++) sysLog(xx[i]); } // catch } // foo Unlike C++ there may only be one catch block following the try block. The reason is, that there is only one variable type in CSS and it makes no sense to define several catch blocks. throw must be followed by an identifier name or an expression as argument. The identifier may be any simple var/const, or array with any number of dimensions. catch expects an identifier followed by empty braces [ ] as parameter. No matter what number of dimensions the thrown value had, the cought value will be a one-dimensional array. | ||||||||
Copyright © IBK Landquart | Last revised by Peter Koch, 24.02.00 | << Back Top Next >> |