Hello I wanna know if are some function to check what is the max value from an array
or if I have to loop the array to compare all numbers to get the biggest one
Just copy the 1st element for the initial max value
Code:
max_value := arr[[I]LowerBound[/I]]
FOR i := [I]LowerBound+1[/I] TO [I]UpperBound [/I]BY 1 DO
IF arr[i] > max_value THEN
max_value := arr[i];
END_IF;
END_FOR;
Hoping for SCL/ST syntax to be array-aware is a bit much, don't you think? This isn't Python [summax = max(A+B) # with the numpy module] or a real, extendable language, although you should be able to at least abstract it away to a function.