Does anyone know how to find an array or do simple math with OpenDmis callouts? I have found wall thickness in 32 positions on our part and I want to a) find the minimum distance, b) find the maximum distance, and c) subtract the min from the max and display the values in the output. If this can be done, can it also be done when using a loop cycle, where the program is just spitting out results, but not saving the positions to a database? I have several programs where this would be useful, so I hope it can be done! Thanks!
Try this. See if it works for you ...
$$ ARRAY VARIABLE CONTAINING DATA POINTS
DECL/LOCAL,DOUBLE,ARRAY[32]
$$ COUNTER VARIABLE FOR LOOPS
DECL/LOCAL,INTGR,Idx
$$ VARIABLES TO CONTAIN INFORMATION
DECL/LOCAL,DOUBLE,MAXIMUM,MINIMUM,RANGE
$$ INITIALIZE STARTING POINT
MAXIMUM=ASSIGN/ARRAY[1]
MINIMUM=ASSIGN/ARRAY[1]
$$ LOOP TO DETERMINE MAXIMUM VALUE
DO/Idx,2,32
IF/(ARRAY[Idx].GT.MAXIMUM)
MAXIMUM=ASSIGN/ARRAY[Idx]
ELSE
ENDIF
ENDDO
$$ LOOP TO DETERMINE MINIMUM VALUE
DO/Idx,2,32
IF/(ARRAY[Idx].LT.MINIMUM)
MINIMUM=ASSIGN/ARRAY[Idx]
ELSE
ENDIF
ENDDO
$$ RANGE VALUE ASSIGNMENT
RANGE=ASSIGN/MAXIMUM-MINIMUM