11-13-2012 12:13 PM
I may be overlooking something very simple here but I need to find out at what index the max value occurs for a channel. I need the index so I can look up other data at the same index in a script. Sorry for asking what is probably a newbie question. Thanks.
11-14-2012 12:48 AM
Hi ric.winters,
Please use the function PNO, which returns the index of a given value in a channel.
Greetings
Walter
11-14-2012 04:05 AM
Hello ric.winters,
As an example to explain the recommendation made by Walter, here is a little bit of code:
L1 = PnO("Speed",CMax("Speed")) msgbox(L1)
L1 is a user variable (longinteger) provided by DIAdem
PnO determines the row in a numeric channel or a text channel, of which the contents are closest to a specified value or text
CMax is a variable that contains the maximum value of a channel
MsgBox generates a message box
The code above will store the index number of the maximum value of the channel called "Speed" in the varibale L1 and subsequently displays that value in a message box.