Click here to Skip to main content
15,886,362 members
Articles / Desktop Programming / ATL

Function Call Tracing in JScript

Rate me:
Please Sign up or sign in to vote.
4.58/5 (18 votes)
3 Jul 2007CPOL15 min read 53.8K   6.4K   49  
Comprehensive JScript function call tracing without code modification.
<!-- 
	Example - Implicit Usage
	
	- JSD must be setup in "Replace Mode".  Also the hosting app must be included in the registry.
	
	- If JSD is not setup in correctly the error "__JSD is undefined" will be raised.
-->
<SCRIPT language="jscript" src="Test.js"></SCRIPT>

<SCRIPT language="jscript">
function AnyFoo()
{
	@if (! @JSD)
		alert("JSD needs to be used implictly for this to work");
		return;
	@end

	// If implicit tracing is turned on should see this function and its return 
	// value in the OutptuDebugString stream.
	return "anyFoo";
}
</SCRIPT>

</HEAD>
<BODY id=oBody>

<BUTTON ID="oButton1" onclick="AnyFoo('hello')">Any Foo</BUTTON>
<BUTTON onclick="clearTrace()">Clear</BUTTON>

</BODY>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions