JavaScript Templates¶
QIE includes several JavaScript templates to facilitate writing common JavaScript functions such as for-loops, while-loops, try-catch statements, etc. These are listed under the Surround With menu item in the Code Wizard.
| Template | Description |
|---|---|
| If Statement | Surround the selected line(s) with an if statement |
| If-Else Statement | Surround the selected line(s) with an if-else statement |
| While Loop | Surround the selected line(s) with a while loop |
| Do-While Loop | Surround the selected line(s) with a do-while loop |
| For Loop | Surround the selected line(s) with a for loop |
| Try-Catch Statement | Surround the selected line(s) with a try-catch statement. The catch statement catches any exceptions thrown inside the try section. |
| Try-Finally Statement | Surround the selected line(s) with a try-finally statement. The finally statement allows cleanup to be performed (close connection, etc.) when an exception is thrown without catching the exception. |
| Try-Catch-Finally Statement | Surround the selected line(s) with a try-catch-finally statement |