13.07.2015 Views

TASKING Script Debugger User Guide

TASKING Script Debugger User Guide

TASKING Script Debugger User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Debugger</strong> <strong>Script</strong> Languagefunc $foo(){$x = 5;$y = 0;}try{// This division by zero error will be caught.$printnl($divide($x, $y));}catch ($e, "#DIV_BY_ZERO"){$printnl("Caught exception: " + $e.$type);}// This division by zero error will not be caught,// assuming none of the callers of $foo() catch it.// The script thread will be terminated.$printnl($divide($x, $y));$foo();2.15.1. Throwing Exceptions Explicitly: throw($e)You can use the throw statement in your script to explicitly throw an exception. It takes a single argument,which must be an instance of class $exception.2.16. Built-in FunctionsThis section provides an overview of the built-in functions that are available in the debugger script language.The functions are grouped per data type for which you can use them. <strong>Debugger</strong> specific functions aredescribed separately.2.16.1. Functions Applicable to All TypesFunction$defined(expression)DescriptionSee Section 2.6, Nil, $defined(...) and $delete(...).$print([ expression, [ expression Prints the provided expressions, with no whitespace in between....]])The variant $printnl(…) appends a newline character.$printnl([ expression, [expression ...]])$delete(variable)$copy(expression)See Section 2.6, Nil, $defined(...) and $delete(...).Returns a reference to a "deep copy" of the expression, i.e. $b=ref $copy($a) is equivalent to $b = $a.29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!