ALTADataSet.Message: Difference between revisions
Jump to navigation
Jump to search
Kate Racaza (talk | contribs) No edit summary |
Kate Racaza (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{Template:API}}{{Template:APIBreadcrumb|.[[ALTADataSet Class|ALTADataSet]]}} | {{Template:API}}{{Template:APIBreadcrumb|.[[ALTADataSet Class|ALTADataSet]]}} | ||
Latest revision as of 23:43, 6 September 2016
Member of: SynthesisAPI.ALTADataSet
Occurs when an error is produced. Displays an error message.
Remarks: To hide the messages or write your own code for the event procedure, set the UseEvents
property of the object to True. The event is raised by the class methods.
Syntax
_Message(msg, IsCritical)
Parameters
msg
- Required. String. The message to display when an error occurs.
IsCritical
- Required. Boolean. Indicates whether the error is critical. Default value = False.
Example
The following example provides a simple demonstration on how to customize the event procedure.
VBA 'Specify a variable to handle the event. Public WithEvents ads As ALTADataSet '---------------------------- Public Sub Main() 'Associate the event variable with an object. Set ads = New ALTADataSet 'Set the application to use your event procedure. ads.UseEvents = True 'Trigger the event by calling the Calculate method without defining a data set. ads.Calculate Msgbox("End") End Sub '---------------------------- Private Sub ads_Message(ByVal msg As String, ByVal IsCritical As Boolean) '<Add code here to handle the event.> MsgBox (msg) End Sub
VB.NET 'Specify a variable to handle the event. Public WithEvents ads As ALTADataSet '---------------------------- Sub Main() 'Associate the event variable with an object. ads = New ALTADataSet 'Set the application to use your event procedure. ads.UseEvents = True 'Trigger the event by calling the Calculate method without defining a data set. ads.Calculate Msgbox("End") End Sub '---------------------------- Private Sub ads_Message(msg As String, IsCritical As Boolean) Handles ads.Message '<Add code here to handle the event.> MsgBox (msg) End Sub