Skip to main content
14-Alexandrite
April 20, 2023
Solved

ModelCHECK: Optional Parameters

  • April 20, 2023
  • 2 replies
  • 1048 views

I have a ModelCHECK use case where some parameters may or may not exist.  I have discovered that if I only list the name of the parameter, then ModelCHECK will not report the parameter as "extra".  But if I add extra requirements to the parameter in the .mcs file then ModelCHECK considers the parameter as "required."   I would prefer to continue to check for "extra parameters" as defined in the conditions file.

 

Can I define the con which is.   "If the parameter exists then it must be a string"

 

In this case "the parameter may exist"

PRT_PARAMETER NOTE

 

In this case "the parameter is required and must be a string"

PRT_PARAMETER NOTE STR

 

 

 

Best answer by Mahesh_Sharma

Hi @N.Barnes 

 

There is no direct option just to check the parameter type, if we use PRT_PARAMETER PARAM_NAME STR EQ *, it will check the parameter and type but create a conflict with existing value of parameter. for example if a parameter "NUMBER" is of real number type with some defined value, when converting it will conflict with string  and may not output as expected. 

 

Thanks. 

2 replies

N.Barnes14-AlexandriteAuthor
14-Alexandrite
April 24, 2023

Spelling Correction:  Can I define the condition which is  "If the parameter exists then it must be a string"

Mahesh_Sharma
22-Sapphire I
April 26, 2023

Hi @N.Barnes 

 

There is no direct option just to check the parameter type, if we use PRT_PARAMETER PARAM_NAME STR EQ *, it will check the parameter and type but create a conflict with existing value of parameter. for example if a parameter "NUMBER" is of real number type with some defined value, when converting it will conflict with string  and may not output as expected. 

 

Thanks.