I enter the following code in syntax editor:
Dim r As Row = Tables("a").Current
If r IsNot Nothing Then
For Each c As Col In Tables("a").Cols
If c.name Then
Dim i As Integer
End If
Next
Then click a button to rearrange the format of the above code. The code of the button is:
Me.ActiveView.ExecuteEditAction(New FormatDocumentAction())
After clicking the button, an argumentoutofrangeexception error will appear:
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=startIndex cannot be larger than the string length.
Arg_ParamName_Name
Source=mscorlib
StackTrace:
at system.string. Substring(Int32 startIndex, Int32 length)
at ActiproSoftware. Internal. K7. ToString (Int32, Int32)
at ActiproSoftware. Internal. Oy. GetSubstring (TextRange LineTerminator)
at ActiproSoftware. Internal. Oy. GetSubstring (Int32, Int32)
at ActiproSoftware. Text. Languages. VB. Implementation. VBTextFormatter. PmM (XR, IToken)
at ActiproSoftware. Text. Languages. VB. Implementation. VBTextFormatter. LMK (XR, IToken)
at ActiproSoftware. Text. Languages. VB. Implementation. VBTextFormatter. XmR (XR, IToken)
at ActiproSoftware. Text. Languages. VB. Implementation. VBTextFormatter. The Format (ITextSnapshot snapshot,ITextPositionRangeCollection selectionPositionRanges, TextFormatMode mode)
ar ActiproSoftware. UI. WinForms. Controls. SyntaxEditor. EditActions. FormatDocumentAction. Execute (IEditorView view)
at ActiproSoftware. UI. WinForms. Controls. SyntaxEditor. Primitives. EditorView. ExecuteEditAction (IEditAction action)
......
[Modified 2 years ago]