Looking for opinions/feedback on the usefulness of the following code implementation -- a shorthand for longer blocks of implicit code, commonly encountered:
__________
LCAP & UCAP
Cap/limit a variable's min/max value. Possibly referencing the current/floating val of another variable, or else fixed with option parameter, eg., "F". Capped variable values are assessed/adjusted only during assignment. Hypothetical examples:
LCAP X (-4.5) ' IF X < -4.5 then X = -4.5
X = 2 - 10
print X
>> -4.5
- - - - - - - - - -
UCAP X (A + 5): LCAP Y (X) ' IF X > A + 5 then X = [Current Value of A] + 5
A = 4: X = 10: Y = 4 ' & IF Y < X then Y = [Current Value of X]
print X; Y
>> 9 9
A = 3
print X; Y
>> 9 9
X = X: Y = -Y ' X / Y retain value until reassigned/reassessed
print X; Y
>> 8 8
- - - - - - - - - -
UCAP X (A + 5), F: LCAP Y (X) ' X-Max locks at 1st assigned value vs. A (unless eg., _FREECAP), Y can float
A = 4: X = 10: Y = 4
print X; Y
>> 9 9
A = 3
print X; Y
>> 9 9
X = X: Y = -Y
print X; Y
>> 9 9
- - - - - - - - - -
UCAP X (A + 5): LCAP Y (X), F ' Y-Min locks at 1st assigned val vs. X, X can float
A = 4: X = 10: Y = 4
print X; Y
>> 9 9
A = 3
print X; Y
>> 9 9
X = X: Y = -Y
print X; Y
>> 8 9