Difference between revisions of "ALTADataSet.Question"

From ReliaWiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:APIClass|ALTAEvents Class|ALTAEvents}}
+
{{Template:API}}{{Template:APIBreadcrumb|.[[ALTADataSet Class|ALTADataSet]]}}
{{Template:WeibullEvents.Question.Cmt}}
+
{{Template:InProgress}}
 +
 
 +
<onlyinclude>Occurs when an answer to a question is required. Displays a message box with yes and no options.</onlyinclude>
 +
 
 +
 
 +
{{Template:API_EventsNote}}
  
 
== Syntax ==
 
== Syntax ==
<ul><li>Question(
+
'''_Question'''(''msg'', ''Buttons'', {{APIPrefix|ByRef}} ''Answer'')
sender
 
{{APIPrefix|As}}
 
[[ALTADataSet Class|ALTADataSet]],
 
sMsg
 
{{APIPrefix|As String}}
 
,
 
Buttons
 
{{APIPrefix|As}}
 
MsgBoxStyle ,
 
Answer
 
{{APIPrefix|As}}
 
MsgBoxResult )
 
</li></ul>
 
  
Parameters
+
===Parameters===
:''sender'': An [[ALTADataSet Class|ALTADataSet]] object.
+
''sMsg''
 +
:Required. String. The message to display.
  
:''sMsg'': The main display label.
+
''Buttons''
 +
: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]).
  
:''Buttons'': The MsgBoxStyle that determines the number and display of the buttons. See [http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxstyle.aspx MsgBoxStyle] for additional details.
+
''Answer''
 +
: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]).
  
:''Answer'': The MsgBoxResult that is returned by the prompt. See [http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.msgboxresult.aspx MsgBoxResult] for additional details.
+
<!--== Example ==
 +
The following example provides a simple demonstration on how to customize the event procedure.
 +
'''VBA'''
 +
 +
{{APIComment|'Specify a variable to handle the event.}}
 +
  {{APIPrefix|Private WithEvents}} ads {{APIPrefix|As}} ALTADataSet
 +
 +
{{APIComment|'----------------------------}}
 +
  {{APIPrefix|Sub}} Main()
 +
  {{APIComment|'Associate the event variable with an object.}}
 +
    {{APIPrefix|Set}} ads = {{APIPrefix|New}} ALTADataSet
 +
 +
  {{APIComment|'Set the application to use your event procedure.}}
 +
    ads.UseEvents = True
 +
 +
  {{APIComment|'Define two stress types.}}
 +
    {{APIPrefix|Call}} ads.AddStressDefinition({{APIString|"Temperature"}}, , 300)
 +
    {{APIPrefix|Call}} ads.AddStressDefinition({{APIString|"Humidity"}}, , 0.3)
 +
 +
  {{APIComment|'Select to use the Temperature-Humidity model with a Weibull distribution.}}
 +
    ads.AnalysisSettings.ModelType = ALTASolverModel_TempHumidity
 +
    ads.AnalysisSettings.Distribution = ALTASolverDistribution_Weibull
 +
 +
  {{APIComment|'Trigger the event by analyzing an incomplete data set.}}
 +
    {{APIPrefix|Call}} ads.AddFailure_3(248, 1, 406, 0.5)
 +
    {{APIPrefix|Call}} ads.AddFailure_3(456, 1, 416, 0.7)
 +
    {{APIPrefix|Call}} ads.AddFailure_3(528, 1, 426, 0.9)
 +
 +
    ads.Calculate
 +
    Msgbox({{APIString|"End"}})
 +
  {{APIPrefix|End Sub}}
 +
 +
{{APIComment|'----------------------------}}
 +
  {{APIPrefix|Private Sub}} ads_Question({{APIPrefix|ByVal}} ''msg'' {{APIPrefix|As String}}, _
 +
                          {{APIPrefix|ByVal}} ''Buttons'' {{APIPrefix|As Microsoft_VisualBasic.MsgBoxStyle}}, _
 +
                          ''Answer'' {{APIPrefix|As Microsoft_VisualBasic.MsgBoxResult}})
 +
  {{APIComment|'<Add code here to handle the event.>}}
 +
    {{APIPrefix|Call}} MsgBox (msg, vbYesNoCancel)
 +
  {{APIPrefix|End Sub}}
  
{{Template:ALTAEvents.Question.Ex}}
+
'''VB.NET'''
 +
 +
{{APIComment|'Specify a variable to handle the event.}}
 +
  {{APIPrefix|Private WithEvents}} ads {{APIPrefix|As}} ALTADataSet
 +
 +
{{APIComment|'----------------------------}}
 +
  {{APIPrefix|Sub}} Main()
 +
  {{APIComment|'Associate the event variable with an object.}}
 +
    ads = {{APIPrefix|New}} ALTADataSet
 +
 +
  {{APIComment|'Set the application to use your event procedure.}}
 +
    ads.UseEvents = True
 +
 +
  {{APIComment|'Define two stress types.}}
 +
    ads.AddStressDefinition({{APIString|"Temperature"}}, , 300)
 +
    ads.AddStressDefinition({{APIString|"Humidity"}}, , 0.3)
 +
 +
  {{APIComment|'Select to use the Temperature-Humidity model with a Weibull distribution.}}
 +
    ads.AnalysisSettings.ModelType = ALTASolverModel.TempHumidity
 +
    ads.AnalysisSettings.Distribution = ALTASolverDistribution.Weibull
 +
 +
  {{APIComment|'Trigger the event by analyzing an incomplete data set.}}
 +
    ads.AddFailure(248, 1, 406, 0.5)
 +
    ads.AddFailure(456, 1, 416, 0.7)
 +
    ads.AddFailure(528, 1, 426, 0.9)
 +
 +
    ads.Calculate
 +
    Msgbox({{APIString|"End"}})
 +
  {{APIPrefix|End Sub}}
 +
 +
{{APIComment|'----------------------------}}
 +
  {{APIPrefix|Private Sub}} ads_Question(''msg'' {{APIPrefix|As String}}, ''Buttons'' {{APIPrefix|As MsgBoxStyle}}, _
 +
                          {{APIPrefix|ByRef}} ''Answer'' {{APIPrefix|As MsgBoxResult}}) {{APIPrefix|Handles}} ads.Question
 +
  {{APIComment|'<Add code here to handle the event.>}}
 +
    MsgBox (msg, vbYesNoCancel)
 +
  {{APIPrefix|End Sub}}
 +
-->

Latest revision as of 00:01, 7 September 2016

APIWiki.png


Member of: SynthesisAPI.ALTADataSet

DRAFT GRAY.png

WORK IN PROGRESS
ALTADataSet.Question

DRAFT GRAY.png

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).