Talk:WeibullDataSet.Message/Notes: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
(Replaced content with 'DRAFT')
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
=DRAFT= __NOTOC__
DRAFT
 
Occurs when the <code>Calculate</code> or <code>CalculateBestFit</code> method is called but no data set has been defined or there is insufficient data to calculate the parameters of a distribution.
 
To handle custom events, set the <code>UseEvents</code> property of the object to True. The <code>Calculate</code> method raises the event once, when it is unable to calculate the parameters of the data. The <code>CalculateBestFit</code> method raises the event for each distribution that is selected to be included in the analysis.
 
== Syntax ==
'''_Message'''({{APIPrefix|ByVal}} ''msg'' {{APIPrefix|As String}}, {{APIPrefix|ByVal}} ''IsCritical'' {{APIPrefix|As Boolean}})
 
===Parameters===
''msg''
: The error message.
''IsCritical''
: Indicates whether the message displayed is critical.
 
 
== Example ==
The following example provides a simple demonstration on how to handle a custom event.
'''VBA'''
{{APIComment|'Specify a variable to handle the event.}}
  {{APIPrefix|Private WithEvents}} wds {{APIPrefix|As}} WeibullDataSet
  {{APIPrefix|Sub}} Main()
  {{APIComment|'Associate the event variable with an object.}}
    {{APIPrefix|Set}} wds = {{APIPrefix|New}} WeibullDataSet
  {{APIComment|'Set the application to handle custom events.}}
    wds.UseEvents = True
  {{APIComment|'To raise the event, call the Calculate method without defining a data set. }}
    wds.Calculate
    Msgbox({{APIString|"End"}})
  {{APIPrefix|End Sub}}
{{APIComment|'----------------------------}}
  {{APIPrefix|Private Sub}} wds_Message({{APIPrefix|ByVal}} Msg {{APIPrefix|As String}}, {{APIPrefix|ByVal}} IsCritical {{APIPrefix|As Boolean}})
  {{APIComment|'<Add code here to handle the event.>}}
    MsgBox ({{APIString|"Message event"}})
  {{APIPrefix|End Sub}}

Latest revision as of 23:35, 11 August 2016

DRAFT