==testScriptVarAccess()== A scriptvariable is copied locally, changes are effective only locally. But if jzcmd.scriptVariables().scriptString is set, it is effective in the script: Text in a script variable: scriptString = scriptStringFirst Changed: scriptString = new text In other method: scriptString = scriptStringFirst In other method: scriptString = changed on script level ==testBatch()== This example creates an batchfile and executes it then. It works for MS-Windows. The batch 'myBatch.bat' contains a 'dir' cmd which's output is redirected in a newly created text file 'out.txt'. After execution this JZcmd subroutine evaluates the 'out.txt'. It searches in the line containing 'myBatch' in the and shows it. ===Variantes of currdir: === jzcmd.scriptLevel.currdir = D:\vishia\ZBNF\sf\ZBNF\examples_JZcmd\TestAll jzcmd.currdir() = D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll jzcmdsub.currdir = D:\vishia\ZBNF\sf\ZBNF\examples_JZcmd jzcmdsub.currdir = D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd executes myBatch.bat, creates out.txt in the current directory ... evaluates 'out.txt': 14.12.2014 22:10 43 myBatch.bat ==testErrorlevel()== testErrorlevel(): 1 < 5 testErrorlevel(): 2 < 5 testErrorlevel(): 2 >= 2 testErrorlevel(): 3 < 5 testErrorlevel(): 3 >= 2 testErrorlevel(): exeception handling ==testOutputTextIndent()== First line left aligned Second line left aligned Third line left aligned forth line 2 spaces, continue of forth line, one space fifth line left aligned. ==testDebugErrorMsg()== Variable not exists: Any error in 'testDebugErrorMsg': java.lang.NoSuchFieldException: faultyVariable; in statement: @D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll/testAll.jz.bat:163,28; e <*) ==testErrorToOutput()== unknown variable: ? java.lang.NoSuchFieldException: unknown; in statement: @D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll/testAll.jz.bat:186,25; e <*) ??> unknown variable: there is an error: java.lang.NoSuchFieldException: unknown; in statement: @D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll/testAll.jz.bat:188,25; e <*) The error with stacktrace: JZcmd.execute - exception at; @D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll/testAll.jz.bat:188,25; e <*);; java.lang.NoSuchFieldException: unknown; org.vishia.util.DataAccess.getData(DataAccess.java:1483); org.vishia.util.DataAccess.access(DataAccess.java:882); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.dataAccess(JZcmdExecuter.java:2286); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.executeDatatext(JZcmdExecuter.java:1872); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.execute(JZcmdExecuter.java:896); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.textAppendToVar(JZcmdExecuter.java:1395); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.execute(JZcmdExecuter.java:849); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.execSubroutine(JZcmdExecuter.java:1595); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.execCall(JZcmdExecuter.java:1449); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.execute(JZcmdExecuter.java:897); org.vishia.cmd.JZcmdExecuter$ExecuteLevel.access$000(JZcmdExecuter.java:658); org.vishia.cmd.JZcmdExecuter.execute(JZcmdExecuter.java:549); org.vishia.zcmd.JZcmd.execute(JZcmd.java:555); org.vishia.zcmd.JZcmd.execute(JZcmd.java:524); org.vishia.zcmd.JZcmd.smain(JZcmd.java:321); org.vishia.zcmd.JZcmd.main(JZcmd.java:244); test throw... error throw: org.vishia.cmd.JZcmdExecuter$JZcmdThrow: text; in statement: @D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll/testAll.jz.bat:195,7; r ==TestErrorSub.test()== TestErrorSub - onerror reached: java.lang.NoSuchFieldException: nonexistVariable; in statement: @D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll/testAll.jz.bat:205,11; S Defvariable [xx:S] ==TestExceptionInException== TestExceptionInException with errorneous: An inner onerror catches the error in an error handling: java.lang.NoSuchFieldException: unknownVariable; in statement: @D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll/testAll.jz.bat:229,53; e <*) Second error is not catched: An onerror block in an outer routine should be correct: java.lang.NoSuchFieldException: unknownVariable; in statement: @D:/vishia/ZBNF/sf/ZBNF/examples_JZcmd/TestAll/testAll.jz.bat:237,40; e <*) ==testDataAccess()== Text in a user Java instance: scriptObj.simpleTestString = the simple test string. Changed scriptObj.simpeTestString = "new text"; result = new text ==testMethodInvoke()== file=D:\vishia\ZBNF\sf\ZBNF\examples_JZcmd\TestAll\myFile file=D:\vishia\ZBNF\sf\ZBNF\examples_JZcmd\TestAll\path\myFile.ext char=x, text=text char=a char=a char=a char=a text=a text=content of org.vishia.zcmd.JZcmdUserExample@6e0d6ee0 ==testCalctime()==