Example: lr.abort

In the following example, lr.abort aborts the script if it cannot open a file.

try {
     File file = new File("c:/temp/Java" + Thread.currentThread() + ".txt");
     FileOutputStream fos = new FileOutputStream(file.getName());
     outstr = new PrintStream(fos);
}

catch (IOException e) {
     outstr = null;
     outstr.println("Init (vuser " + lr.get_vuser_id() + ")");
    lr.abort( );
};