/*
JScript example demonstrating disabling of command logging
*/
var cmd = Application.CreateCommand("CustomCmd") ;
cmd.ScriptingName = "CustomCmd" ;
cmd.Handler = "Foo" ;
// Although we define the command with jscript
// the embedded code is vbscript!
cmd.Language = "VBScript" ;
cmd.Code =
"sub Foo()\n" +
" Logmessage \"CustomCmd called\" \n" +
"end sub" ;
cmd.ReturnValue = false ;
cmd.SetFlag(siNoLogging);
Application.AddCommand( cmd ) ;
// Call the routine:
Logmessage( "About to call custom cmd:" );
CustomCmd() ;
Logmessage( "Finished calling custom cmd" );
// Result: In the script history the Logmessage call is shown
// but the name CustomCmd is not logged.
//INFO : About to call custom cmd:
//INFO : CustomCmd called
//INFO : Finished calling custom cmd
//If we had not set the siNoLogging then this would be the logged results:
/*
//INFO : About to call custom cmd:
//INFO : CustomCmd called
CustomCmd();
//INFO : Finished calling custom cmd
*/
Application.RemoveCommand("CustomCmd")
|