Altova XMLSpy 2025 Professional Edition 

Event: OnChar(nChar as Long, bExistSuggestion as Boolean) as Boolean

 

Description

This event gets fired on each key stroke. The parameter nChar is the key that was pressed and bExistSuggestions tells whether a XMLSpy generated suggestions window is displayed after this key. The Document property Suggestions contains a string array that is recommended to the user. It is possible to modify the displayed recommendations during this event. Before doing so you have to assign an empty array to the Suggestions property. The best location for this is the OnDocumentOpened event. To prevent the suggestion window to show up return false and true to continue its display.

It is also possible to create a new suggestions window when none is provided by XMLSpy. Set the Document property Suggestions to a string array with your recommendations and return true.

This event is fired before the OnBeforeShowSuggestions event. If you prevent to show the suggestion window by returning false then OnBeforeShowSuggestions is not fired.

 

Examples

Given below are examples of how this event can be scripted.

 

XMLSpy scripting environment - VBScript:

Function On_Char(nChar, bExistSuggestions)

End Function

 

XMLSpy scripting environment - JScript:

function On_Char(nChar, bExistSuggestions)

{

}

 

XMLSpy IDE Plugin:

IXMLSpyPlugIn.OnEvent (35, ...)        // nEventId = 35

 

 

© 2018-2024 Altova GmbH