logo
Home XtGem- Templates- XtScript- bottom
XtGemmanual

XtScript basics

debugging tools

Debug functions that will help you:

Syntax

call dump_vars call dump_functions call args $foo=bar;$x=y;a=1 call execution_time[...] optional · ... your value

Example

<!--parser:xtscript-->
function test_function_0 $arg=apple
print $arg ;
endfunction 
function test_function_1 $arg=banana
print $arg ;
endfunction 

# dump of function names
call dump_functions


var $my_var=my value 
var $my_other_var=my other value
var $html = <div>hello</div>;
# dump of variables
call dump_vars

#better dump_vars 
print <br />Better dump_vars<br />
var $dump=call dump_vars
var $dump=call trim $val=$dump ; $charlist={{<pre>
Array/ }}
var $dump=call trim $val=$dump ; $charlist=( )
var $dump=call htmlspecialchars $val=$dump
var $dump=call nl2br $val=$dump
print <div>$dump</div>

#script execution time
 call execution_time
<!--/parser:xtscript-->

Copy as text

This example reads visitor input (URL or cookies), so it is shown as code only. Copy it to your site to try it.

Related

source comments

XtGem manual · all sections

Powered by XtGem
About us Contact Forum top