Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]
Writes a string to the console.
System.Debug.outputString(
strOutputString
)
strOutputString [in]
String to write to the console.
This method does not return a value.
Useful for sending variable values, gadget state, or function names to the console for debugging.
The value of strOutputString
can only be viewed with a script debugger while the gadget is running.
The following example demonstrates how to throw an error and use outputString to display it in a debugger console.
// --------------------------------------------------------------------
// Attempt to save the file and throw an error if the file name does
// not include a file name extension.
// --------------------------------------------------------------------
function SaveFile()
{
var fso = new ActiveXObject( "Scripting.FileSystemObject" );
// Throw an arbitrary error to demonstrate the outputString method.
try
{
if (sFilename.indexOf(".") == -1)
{
throw "'File name' does not specify a file name extension.";
}
var file =
fso.OpenTextFile(sFilePath + sFilename,
FOR_WRITING, CREATE_NEW);
file.Write(sContent);
file.Close();
fso = file = null;
}
catch(e)
{
System.Debug.outputString(e);
}
}
Minimum supported client |
Windows Vista [desktop apps only] |
Minimum supported server |
Windows Server 2008 [desktop apps only] |
End of client support |
Windows 7 |
End of server support |
Windows Server 2008 |
IDL |
|
DLL |
|
Please sign in to use this experience.
Sign in