Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Trace.Indent Method

Increases the current IndentLevel by one.

[Visual Basic]
<Conditional("TRACE")>
Public Shared Sub Indent()
[C#]
[Conditional("TRACE")]
public static void Indent();
[C++]
[Conditional("TRACE")]
public: static void Indent();
[JScript]
public
   Conditional("TRACE")
static function Indent();

Example

The following example increments and decrements the indent level and emits tracing messages.

[Visual Basic] 
Trace.WriteLine("List of errors:")
Trace.Indent()
Trace.WriteLine("Error 1: File not found")
Trace.WriteLine("Error 2: Directory not found")
Trace.Unindent()
Trace.WriteLine("End of list of errors")


[C#] 
Trace.WriteLine("List of errors:");
 Trace.Indent();
 Trace.WriteLine("Error 1: File not found");
 Trace.WriteLine("Error 2: Directory not found");
 Trace.Unindent();
 Trace.WriteLine("End of list of errors");
   

[C++] 
Trace::WriteLine(S"List of errors:");
 Trace::Indent();
 Trace::WriteLine(S"Error 1: File not found");
 Trace::WriteLine(S"Error 2: Directory not found");
 Trace::Unindent();
 Trace::WriteLine(S"End of list of errors");
   

[JScript] 
Trace.WriteLine("List of errors:")
Trace.Indent()
Trace.WriteLine("Error 1: File not found")
Trace.WriteLine("Error 2: Directory not found")
Trace.Unindent()
Trace.WriteLine("End of list of errors")

This example produces the following output:

List of errors:
     Error 1: File not found
     Error 2: Directory not found
End of list of errors
   

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Trace Class | Trace Members | System.Diagnostics Namespace | Unindent | IndentLevel | IndentSize

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft