Jump to content

IF_ENDIF Statement Issues


---
 Share

Recommended Posts

Hello,

I have several characteristic values. I want find the range of the deviations and report them in a Result Element. Basically find the char that is the furthest positive value (if any) from nominal and the char with the furthest negative value (if any) from nominal. And use both values to calculate the range. View of the characteristics are the same. So a lot of the feature based options will not work. So I'm trying to figure out how to use PCM to get what I need. I would really be interested in learning how to use an if_endif statement to do this, since I've had so much trouble figuring this function out.

If there is another way, of course I would be interested to know how, but I would also appreciate some guidance on using the if_endif statement. Thanks so much.
Link to comment
Share on other sites

if you dont have to many characteristics:
Range = max(getActual("DiamCircle1").actual,getActual("DiamCircle2").actual,getActual("DiamCircle3").actual) - min(getActual("DiamCircle1").actual,getActual("DiamCircle2").actual,getActual("DiamCircle3").actual)

if you have many characteristics:

ChrVar=""
for n = 1 to 50
ChrVar=ChrVar + "getActual(" + chr(34) + "DiamCircle" + n + chr(34) + ").actual"  + ", "
next n
ChrVar = mid(ChrVar,1,len(ChrVar)-2)

Range = compute("max(" + ChrVar  + ") - min(" + ChrVar  + ")" )  
Link to comment
Share on other sites

 Share

×
×
  • Create New...