Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculating the High and Low of it all
#3
Try this, instead.

Demo

Code: (Select All)
DataBaseValue$ = "7,3,9,4,2,6,2,8"
FOR i = 0 TO 7
    DataBaseValue = VAL(MID$(DataBaseValue$, i * 2 + 1, 1))
    FOR j = 0 TO 7
        DataBaseValue = VAL(MID$(DataBaseValue$, j * 2 + 1, 1))
        IF i <> j THEN
            IF DataBaseValue > HL THEN SWAP HL, DataBaseValue ELSE low = DataBaseValue
            'Low = (_ROUND(Low * 100000)) / 100000
            'HL = (_ROUND(HL * 100000)) / 100000
        END IF
    NEXT
NEXT
PRINT "Low ="; low, "High ="; HL

Pete
Reply


Messages In This Thread
RE: Calculating the High and Low of it all - by Pete - 10-18-2022, 07:13 PM



Users browsing this thread: 17 Guest(s)