The following example will erase all the steps in the current task, which consequently sets the TaskCount property to zero.
Sub Main
CurrentTask2.ClearSteps
End Sub