[error_reset]

Description

Link: [error_reset]
Author: Jason Huck
Category: Error
Version: 8.x
License:
Posted: Nov. 29, 2006
Updated: Jan. 01, 0001
More by this author...
Called without parameters, this tag clears any previously set error code and/or message, setting it back to the default of 0:No error. Or, you can provide the error code and message you wish to use as params to the tag.

Parameters

-code integer, optional The error code to use when resetting.
-msg string, optional The error message to use when resetting.

Sample Usage

error_code + ': ' + error_msg + '<br />\n';
error_reset(-9953, 'Unknown error.');

error_code + ': ' + error_msg + '<br />\n';
error_reset;

error_code + ': ' + error_msg + '<br />\n';
error_reset(5000, 'Custom error.');

error_code + ': ' + error_msg + '<br />\n';
error_reset(-9953);

error_code + ': ' + error_msg + '<br />\n';
						

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
define_tag(
	'reset',
	-namespace='error_',
	-opt='code', -type='integer',
	-opt='msg', -type='string',
	-priority='replace',
	-description='Resets the current error message/code.'
);
	!local_defined('code') ? local('code') = error_noerror( -errorcode);		
	error_msg = '';
	error_seterrorcode(#code);		
	!local_defined('msg') ? local('msg') = error_msg;
	error_seterrormessage(#msg);
/define_tag;

 

Comments

none

Email:


Password:



Newest

Most Popular