Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculating the High and Low of it all
#11
HL = DataBaseValue
        If HL < Low Then Low = (_Round(HL * 100000)) / 100000
        If HL > High Then High = (_Round(HL * 100000)) / 100000


And *before* your DO-LOOP where you check those values, initialize the high/low variables.

LOW = *max variable value*
HIGH = *min variable value*

So for an unsigned byte, LOW = 255: HIGH = 0.  For an unsigned integer, LOW = 65535: HIGH = 0.

This way *any* database value will be less than LOW, setting it to the database limit, while the same is true with the HIGH.
Reply


Messages In This Thread
RE: Calculating the High and Low of it all - by SMcNeill - 10-19-2022, 07:24 AM



Users browsing this thread: 9 Guest(s)