Posted 15 years ago by painetraine
Avatar
I am getting the following error:

Error in Start : The offset '209' added to the length '478' must be less than or equal to the count of characters in the document.
at ActiproSoftware.SyntaxEditor.Document.ᐂ(Int32 , Int32 )
at ActiproSoftware.SyntaxEditor.Document.GetSubstring(Int32 offset, Int32 length)
at ActiproSoftware.SyntaxEditor.EditorView.get_SelectedText()

This occurs when I do the following steps:

1. Paste some text into SyntaxEditor
2. Highlight the Text
3. Press F5 or some other key

My code then does one of the following that must be causing the error (since these are the only lines that reference the editor control in the function where the error occurs)

strText = this.editor.Document.CurrentView.Selection.View.SelectedText;
if (strText == "")
strText = this.editor.Text;

It doesn't happen every time but just on occassion and I can't figure out why this would be happening.

Thanks

Comments (3)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I've seen that happen and haven't been able to dupe it so that we can fix it. If you're able to determine steps to repro it, please post them and we'll get it fixed right away.


Actipro Software Support

Posted 14 years ago by OPaakkon
Avatar
It seems to have something to do with end of document. I get the same problem by highlighting last lines and pressing XTRL-X. I guess it's related with odd behaviour of first selected line as the mouse passes the last line: if the cursor is in text selection area (between left edge of text and left edge of control), the first line becomes unselected.

The error message I get is a bit different:

An unhandled exception of type 'System.ArgumentException' occurred in actiprosoftware.syntaxeditor.dll

Additional information: The offset '3351' added to the length '385' must be less than or equal to the count of characters in the document.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Do you run the latest version? Also, can you give me exact steps to reproduce it in the sample application?


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.