[Debug]

Description

Link: [Debug]
Author: Eric Landmann
Category: Utility
Version: 8.x
License: Public Domain
Posted: Jun. 23, 2008
Updated: Jan. 01, 0001
More by this author...

Creates a debug container to output debugging information. Works in conjunction with $xDebug = Y as a toggle to turn on/off debugging information. Uses a special stylesheet class called "debug" to format output.

Parameters

none


Sample Usage

Debug;
'SomeVar = ' $SomeVar '<br>\n';
'AnotherVar = ' $AnotherVar '\n';
/Debug;
						

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?Lassoscript
// Last modified 6/23/08 by ECL, Landmann InterActive
// For LDC 08 presentation

// Tagname			Debug
// Description		Creates a debug container
// Author			Eric Landmann
// Date				6/23/2008
// Usage			Debug;
//						'SomeVar = ' $SomeVar '<br>\n';
//					/Debug;
// Expected Output	If $xDebug = Y, contents of debug container will be output
//					If $xDebug != Y, nothing will output
If: !(Lasso_TagExists:'Debug');
	Define_Tag: 'Debug',
		-Container;

		Local('Start') = ('<p class="debug"><strong>' + (Response_Filepath) + '</strong><br>\n');
		Local('End') = '</p>\n';
		If: (Var:'xDebug') == 'Y';
			Local('Output') = (#Start) + (Run_Children) + (#End);
		Else;
			Local('Output') = ('<!-- Debugging is off -->\n');
		/If;
		Return: (Encode_Smart:#Output);

	/Define_Tag;

	Log_Critical: 'Custom Tag Loaded - Debug';

/If;

/*
// Testing
Var:'xDebug' = 'Y';
Var:'SomeVar' = 'booha';

Debug;
	'SomeVar = ' $SomeVar '<br>\n';
/Debug;
*/
?>

 

Comments

none

Email:


Password:



Newest

Most Popular