Help to Get The highest value in Array


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133

    Question Help to Get The highest value in Array

    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

  2. #2
    Join Date
    Aug 2005
    Location
    antipolo city, philippines
    Posts
    23


    Did you find this post helpful? Yes | No

    Default max operator

    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

  3. #3
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133


    Did you find this post helpful? Yes | No

    Question Help to Get The highest value in Array

    I now that i have the manual.

    If some one don this some help



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

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Simple Array Demo
    By Archangel in forum Code Examples
    Replies: 5
    Last Post: - 15th February 2010, 04:46
  3. Filling pdu array with gps data!
    By camolas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th October 2008, 00:54
  4. RS232 receive an array (packet)
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th February 2008, 05:02
  5. Reading Array values into variables
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 21st March 2005, 10:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts