PDA

View Full Version : Help to Get The highest value in Array



jetpr
- 11th August 2005, 01:42
I do not have no idea who this work?

sRead VAR WORD[10]
sValue VAR WORD
Example

for x=1 to 10
sValue=MAX sRead[x]
next x

yettie
- 11th August 2005, 02:07
jetpr,

good day. sVar=MAX sRead[x] command will not give the element with highest value in the sRead array. MAX and MIN operator will only give you a (limits) ceiling or floor value from an operation. the web manual seems to be clear, http://www.microengineeringlabs.com/resources/pbpmanual and look for the max and min operator with example.

regards,
yettie

jetpr
- 11th August 2005, 02:14
I now that i have the manual.

If some one don this some help



for x=1 to 10
sValue= sRead[x]
next x

Melanie
- 11th August 2005, 11:09
You need to compare EVERY individual element in the array against sValue and then if it is bigger to replace sValue with that array elements content. This is one of those 'homework' type questions... which you need to think out for yourself.