Libraries.System.StackTraceItem Documentation

The StackTraceItem is a helper class that represents an item on the call stack. It is used by the Error classes to generate stack traces.

Example Code

use Libraries.System.StackTraceItem

class MyCallStack<Type>
StackTraceItem item
end

Inherits from: Libraries.Language.Object

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Equals(Libraries.Language.Object o)

Determines if StackTraceItem's have equivalent values(class, method, file, and line number).

Parameters

Return

boolean: True if the StackTraceItem's are equal and false if they are not equal.

Example

use Libraries.System.StackTraceItem
StackTraceItem item
StackTraceItem item2
item:Equals(item2)

GetClassName()

Get the name of the class that the activation record originates from.

Return

text: The name of the class on the call stack.

Example

use Libraries.System.StackTraceItem
StackTraceItem item
text clazz = item:GetClassName()

GetFileName()

Get the name of the file that the activation record originates from.

Return

text: The name of the file on the call stack.

Example

use Libraries.System.StackTraceItem
StackTraceItem item
text file = item:GetFileName()

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetLineNumber()

Get the line number that the activation record originates from.

Return

integer: The line number of the item on the call stack.

Example

use Libraries.System.StackTraceItem
StackTraceItem item
integer line = item:GetLineNumber()

GetMethodName()

Get the name of the method that the activation record originates from.

Return

text: The name of the method on the call stack.

Example

use Libraries.System.StackTraceItem
StackTraceItem item
text method = item:GetMethodName()

Init(text clazz, text method, text file, integer line)

Initialize the stack trace items' class, method, file, and line number.

Parameters

  • text clazz: The name of the class on the call stack.
  • text method: The name of the method (from the activation record) on the call stack.
  • text file: The file path of the class on the call stack.
  • integer line: The line number that the activation record originates from.

Example

use Libraries.System.StackTraceItem
StackTraceItem item
item:Init("MyCallStack", "Call", "Libraries.System.CallStack", 15)