Last typed word (SE3.0)

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by Paul Huckstepp - UK
I have just upgraded from version 2.5 to 3.0 and I have a problem with some existing code:

lastTypedword = Me.codeWindow2.Document.Tokens.GetTokenAtOffset(Me.codeWindow2.Caret.Offset - 1)
End Try

If isFunction(lastTypedword.text) Then
ShowInfoTip(getFunctionDetails(lastTypedword.text) & "")
End If

Previously lastTypedWord.text would return the last typed word (amazing), however the new version doesn't seem to have the property .text, has this changed? or is there a better way of doing this?

Thanks for your help

Comments (2)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Paul,

Yes we removed the Token.Text property because that allowed us to remove a reference to the Document in each Token, which saves on memory usage. Instead we added a Document.GetTokenText method. Use that instead.

This is all detailed in the Converting from Version 2.x to 3.0 topic in the documentation.

Actipro Software Support

Posted 19 years ago by Paul Huckstepp - United Kingdom
Thanks for the quick response.

I did go through the update guide but assumed wrongly that the .GetTokenTexe didn't apply to my code. I've managed to rewrite the sections with the updated syntax.

Thanks again
The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.