CModel.Parameters: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:cModel.Parameters}}
{{DISPLAYTITLE:cModel.Parameters}}{{Template:API}}{{Template:APIBreadcrumb|.[[CModel Class|cModel]]}}
{{Template:APIClass|CModel Class|cModel}}  
 
{{Template:CModel.Parameters.Cmt}}
 
<onlyinclude>Returns an array of '''[[ParamValues Class|ParamValues]]''' objects that represent the parameter name and value pairs of an associated cModel object.</onlyinclude>


== Syntax==
== Syntax==
*Parameters(){{APIPrefix|As}}[[ParamValues Class|ParamValues]]()
'''.Parameters()'''
 


== Usage Example ==
==Example ==
<div style="margin-right: 150px;">
'''VBA|VB.NET'''
  {{APIComment|'Declare the cModel class using an in-line parameter list.}}
   Dim newModel As New cModel(ModelTypeEnum.Weibull2,
{{APIComment|...}}
    ModelCategoryEnum.Reliability, "NewModel1", 1, 100)
 
  {{APIComment|'Add code to get an existing model or create a new one.}}
  {{APIComment|'Get the list of model parameters. See [[ParamValues Class|ParamValues]].}}
   {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
   Dim ModelParameters() As [[ParamValues Class|ParamValues]]
{{APIComment|...}}
   ModelParameters = newModel.Parameters
</div>
  {{APIComment|'Get an array of the model's parameters.}}
   {{APIPrefix|Dim}} ModelParameters() {{APIPrefix|As}} ParamValues
  ModelParameters = AModel.Parameters()
{{APIComment|'Output example: Display the name and value of the first parameter.}}
  Dim ParamName {{APIPrefix|As}} String
  Dim ParamValue {{APIPrefix|As}} Double
   ParamName = ModelParameters(0).ParamName
  ParamValue = ModelParameters(0).Value
  MsgBox (ParamName & " = " & ParamValue)

Latest revision as of 17:53, 17 June 2016

APIWiki.png


Member of: SynthesisAPI.cModel


Returns an array of ParamValues objects that represent the parameter name and value pairs of an associated cModel object.

Syntax

.Parameters()


Example

VBA|VB.NET

 ... 

 'Add code to get an existing model or create a new one. 
 Dim AModel As New cModel
 ... 

 'Get an array of the model's parameters. 
 Dim ModelParameters() As ParamValues
 ModelParameters = AModel.Parameters()

 'Output example: Display the name and value of the first parameter. 
 Dim ParamName As String
 Dim ParamValue As Double
 ParamName = ModelParameters(0).ParamName
 ParamValue = ModelParameters(0).Value
 MsgBox (ParamName & " = " & ParamValue)