bounds test
byte = BoundB(n)
byte = BoundByte(n)
n: integer expression
The BoundB(n) function tests if the parameter n fits in a Byte. This means that when n < 0 or n > 255 an error message is reported. Otherwise n is returned unchanged.
Local a| = 5, b| = 45, c|
c| = BoundB(a| * b|) // 5 * 45 = 225 - No Error
c| = BoundB(c| * 2) // 225 * 2 = 450 - Array Bounds Error
// or...
c| = BoundByte(c| * 2)
The BoundB() function serves to find program errors by early discovery of any range violations. BoundByte is a synonym.
{Created by Sjouke Hamstra; Last updated: 24/09/2014 by James Gaite}