WeibullDataSet.Question: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|.[[WeibullDataSet Class|WeibullDataSet]]}}
{{Template:API}}{{Template:APIBreadcrumb|.[[WeibullDataSet Class|WeibullDataSet]]}}
{{Template:InProgress}}




<onlyinclude>Occurs when an answer to a question is required.</onlyinclude>  
<onlyinclude>Occurs when an answer to a question is required. Displays a message box with yes and no options.</onlyinclude>  




Line 9: Line 8:


== Syntax ==
== Syntax ==
  '''_Question'''({{APIPrefix|ByVal}} ''msg'' {{APIPrefix|As String}}, {{APIPrefix|ByVal}} ''Buttons'' {{APIPrefix|As Microsoft_VisualBasic.MsgBoxStyle}}, {{APIPrefix|ByRef}} ''Answer'' {{APIPrefix|As Microsoft_VisualBasic.MsgBoxResult}})
  '''_Question'''(''msg'', ''Buttons'', {{APIPrefix|ByRef}} ''Answer'')


===Parameters===
===Parameters===
''sMsg''
''sMsg''
:The message to display.
:Required. String. The message to display.


''Buttons''
''Buttons''
:The buttons to display when calling Visual Basic's MsgBox function. (See [https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxstyle.aspx Microsoft's reference documentation].)
:Required. The buttons to display when calling Visual Basic's MsgBox function. Can be any MsgBoxStyle constant (see [https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxstyle.aspx Microsoft's reference documentation for this enum]).


''Answer''
''Answer''
:Indicates which button was pressed in a message box, returned by Visual Basic's MsgBox function. (See [https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxresult.aspx Microsoft's reference documentation].)
:Required. Indicates which button was pressed on a message box returned by Visual Basic's MsgBox function. Can be any MsgBoxResult constant (see [https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxresult.aspx Microsoft's reference documentation for this enum]).


== Example ==
== Example ==
The following example provides a simple demonstration on how to handle the event.
The following example provides a simple demonstration on how to customize the event procedure.
  '''VBA'''
  '''VBA'''
   
   
Line 33: Line 32:
     {{APIPrefix|Set}} wds = {{APIPrefix|New}} WeibullDataSet
     {{APIPrefix|Set}} wds = {{APIPrefix|New}} WeibullDataSet
   
   
   {{APIComment|'Set the application to use events.}}
   {{APIComment|'Set the application to use your event procedure.}}
     wds.UseEvents = True
     wds.UseEvents = True
   
   
   {{APIComment|'To raise the event, calculate a data set with a single data point.}}
   {{APIComment|'To trigger the event, analyze a data set with a single data point.}}
     {{APIPrefix|Call}} wds.AddFailure(100, 1)
     {{APIPrefix|Call}} wds.AddFailure(100, 1)
     wds.Calculate
     wds.Calculate
Line 45: Line 44:
   {{APIPrefix|Private Sub}} wds_Question({{APIPrefix|ByVal}} ''msg'' {{APIPrefix|As String}}, _
   {{APIPrefix|Private Sub}} wds_Question({{APIPrefix|ByVal}} ''msg'' {{APIPrefix|As String}}, _
                           {{APIPrefix|ByVal}} ''Buttons'' {{APIPrefix|As Microsoft_VisualBasic.MsgBoxStyle}}, _
                           {{APIPrefix|ByVal}} ''Buttons'' {{APIPrefix|As Microsoft_VisualBasic.MsgBoxStyle}}, _
                           {{APIPrefix|ByRef}} ''Answer'' {{APIPrefix|As Microsoft_VisualBasic.MsgBoxResult}})
                           ''Answer'' {{APIPrefix|As Microsoft_VisualBasic.MsgBoxResult}})
   {{APIComment|'<Add code here to handle the event.>}}
   {{APIComment|'<Add code here to handle the event.>}}
     MsgBox (msg)
     {{APIPrefix|Call}} MsgBox (msg, vbYesNoCancel)
   {{APIPrefix|End Sub}}
   {{APIPrefix|End Sub}}


Line 60: Line 59:
     wds = {{APIPrefix|New}} WeibullDataSet
     wds = {{APIPrefix|New}} WeibullDataSet
   
   
   {{APIComment|'Set the application to use events.}}
   {{APIComment|'Set the application to use your event procedure.}}
     wds.UseEvents = True
     wds.UseEvents = True
   
   
   {{APIComment|'To raise the event, calculate a data set with a single data point.}}
   {{APIComment|'To trigger the event, analyze a data set with a single data point.}}
     wds.AddFailure(100, 1)
     wds.AddFailure(100, 1)
     wds.Calculate
     wds.Calculate
Line 73: Line 72:
                           {{APIPrefix|ByRef}} ''Answer'' {{APIPrefix|As MsgBoxResult}}) {{APIPrefix|Handles}} wds.Question
                           {{APIPrefix|ByRef}} ''Answer'' {{APIPrefix|As MsgBoxResult}}) {{APIPrefix|Handles}} wds.Question
   {{APIComment|'<Add code here to handle the event.>}}
   {{APIComment|'<Add code here to handle the event.>}}
     MsgBox (msg)
     MsgBox (msg, vbYesNoCancel)
   {{APIPrefix|End Sub}}
   {{APIPrefix|End Sub}}

Latest revision as of 23:41, 6 September 2016

APIWiki.png


Member of: SynthesisAPI.WeibullDataSet


Occurs when an answer to a question is required. Displays a message box with yes and no options.


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

_Question(msg, Buttons, ByRef Answer)

Parameters

sMsg

Required. String. The message to display.

Buttons

Required. The buttons to display when calling Visual Basic's MsgBox function. Can be any MsgBoxStyle constant (see Microsoft's reference documentation for this enum).

Answer

Required. Indicates which button was pressed on a message box returned by Visual Basic's MsgBox function. Can be any MsgBoxResult constant (see Microsoft's reference documentation for this enum).

Example

The following example provides a simple demonstration on how to customize the event procedure.

VBA

 'Specify a variable to handle the event. 
  Private WithEvents wds As WeibullDataSet

 '---------------------------- 
 Sub Main()
   'Associate the event variable with an object. 
    Set wds = New WeibullDataSet

   'Set the application to use your event procedure. 
    wds.UseEvents = True

   'To trigger the event, analyze a data set with a single data point. 
    Call wds.AddFailure(100, 1)
    wds.Calculate
    Msgbox("End")
 End Sub

 '---------------------------- 
 Private Sub wds_Question(ByVal msg As String, _
                          ByVal Buttons As Microsoft_VisualBasic.MsgBoxStyle, _
                          Answer As Microsoft_VisualBasic.MsgBoxResult)
   '<Add code here to handle the event.> 
    Call MsgBox (msg, vbYesNoCancel)
 End Sub
VB.NET

 'Specify a variable to handle the event. 
  Private WithEvents wds As WeibullDataSet

 '---------------------------- 
 Sub Main()
   'Associate the event variable with an object. 
    wds = New WeibullDataSet

   'Set the application to use your event procedure. 
    wds.UseEvents = True

   'To trigger the event, analyze a data set with a single data point. 
    wds.AddFailure(100, 1)
    wds.Calculate
    Msgbox("End")
 End Sub

 '---------------------------- 
 Private Sub wds_Question(msg As String, Buttons As MsgBoxStyle, _
                          ByRef Answer As MsgBoxResult) Handles wds.Question
   '<Add code here to handle the event.> 
    MsgBox (msg, vbYesNoCancel)
 End Sub