WeibullDataSet.GetDistrParameters: Difference between revisions
Albert Szeto (talk | contribs) No edit summary |
Albert Szeto (talk | contribs) No edit summary |
||
Line 58: | Line 58: | ||
Params.Add(New ParamInputInfo("Param1", 0, 10, False, True)) | Params.Add(New ParamInputInfo("Param1", 0, 10, False, True)) | ||
Params.Add(New ParamInputInfo("Param2", 0, Double.MaxValue, False, True)) | Params.Add(New ParamInputInfo("Param2", 0, Double.MaxValue, False, True)) | ||
{{APIComment|Create a Boolean for return of "Cancel" parameter.}} | |||
Dim wasCancelled As Boolean | |||
{{APIComment|Prompt user to input the parameters.}} | {{APIComment|Prompt user to input the parameters.}} | ||
WEvents.GetDistrParameters(WDS, "Message1", True, Params, | WEvents.GetDistrParameters(WDS, "Message1", True, Params, wasCancelled) | ||
{{APIComment|The new Parameter values are in their respective ParamInputInfo.Value variables.}} | {{APIComment|The new Parameter values are in their respective ParamInputInfo.Value variables.}} | ||
Dim NewParameter1value As Double = Params(0).Value | Dim NewParameter1value As Double | ||
Dim NewParameter2value As Double | |||
If Not wasCancelled Then | |||
NewParameter1value = Params(0).Value | |||
NewParameter2value = Params(1).Value | |||
End If |
Revision as of 01:08, 8 October 2013
Displays a prompt for customized parameters.
Method Syntax
GetDistrParameters(
ByVal
sender
As
WeibullDataSet,
ByVal
sMsg
As String
,
ByVal
GetOnlyOneParameter
As Boolean
,
ByVal
Params
As
List(
Of
ParamInputInfo),
ByRef
Cancel
As Boolean
)
Called by ‘sender’ when additional input is required.
Parameters
sender An WeibullDataSet object
sMsg The main display label.
GetOnlyOneParameter Prompt for only one parameter
Params A list of Parameter input information classes, ParamInputInfo, that would be updated by this prompt. After processing with GetDistrParameters, the Value of each parameter will be updated.
Cancel If the prompt was closed by any means other than clicking the "Okay", this value would be set to True.
Usage Example
Declare the WeibullEvents.
Declare the WeibullDataSet.
Note: The WeibullDataSet constructor already creates a new WeibullEvents, which could be used in place of WEvents in the example below.
Dim WEvents As New WeibullEvents Dim WDS As New WeibullDataSet
Creates a new list of ParamInputInfo. Populate the list.
Dim Params As New List(Of ParamInputInfo) Params.Add(New ParamInputInfo("Param1", 0, 10, False, True)) Params.Add(New ParamInputInfo("Param2", 0, Double.MaxValue, False, True))
Create a Boolean for return of "Cancel" parameter.
Dim wasCancelled As Boolean
Prompt user to input the parameters.
WEvents.GetDistrParameters(WDS, "Message1", True, Params, wasCancelled)
The new Parameter values are in their respective ParamInputInfo.Value variables.
Dim NewParameter1value As Double Dim NewParameter2value As Double
If Not wasCancelled Then NewParameter1value = Params(0).Value NewParameter2value = Params(1).Value End If