Posted 18 years ago
by Karl Grambow
Hi,
This is SyntaxEditor v4.0 on .NET 1.1.
I'm having a problem with GetSubString (or rather, document.text.length).
I need to use GetSubstring, where under certain circumstances, the length parameter corresponds to the length of the text. So I effectively do something like:The problem is, if I have multiple lines in the document, the Length property returns 2 for every line so the ultimate length returned is longer than the GetSubString method can handle and it throws an exception.
System.ArgumentException - The text range '{StartOffset=0,EndOffset=88}' must be less than or equal to the count of characters in the document.
If the Length property counts each lineterminator as two characters then shouldn't the text range find that length a valid length?
Thanks,
Karl
This is SyntaxEditor v4.0 on .NET 1.1.
I'm having a problem with GetSubString (or rather, document.text.length).
I need to use GetSubstring, where under certain circumstances, the length parameter corresponds to the length of the text. So I effectively do something like:
Dim text As String = SyntaxEditor1.Document.GetSubstring(0, SyntaxEditor1.Text.Length)
System.ArgumentException - The text range '{StartOffset=0,EndOffset=88}' must be less than or equal to the count of characters in the document.
If the Length property counts each lineterminator as two characters then shouldn't the text range find that length a valid length?
Thanks,
Karl