highest or lowest variable in an array; how do you find it?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default Re: highest or lowest variable in an array; how do you find it?

    Quote Originally Posted by DDDvvv View Post
    Hi everyone.
    im trying to determine the highest and lowest variable in a 50 byte array. whats the easiest way to do it?
    yArray VAR BYTE[50]
    yLow VAR BYTE
    yLow = 255
    yHigh VAR BYTE
    yHigh = 0
    i VAR BYTE

    FOR i = 0 TO 49
    IF yArray[i] < yLow THEN
    yLow = yArray[i]
    endif
    IF yArray[i] > yHigh THEN
    yHigh = yArray[i]
    ENDIF
    NEXT


    Not being duplicative just that ScaleRobotics Posted First.

    Norm
    Last edited by Normnet; - 12th July 2012 at 20:53.

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