ClipRange#
Result# = ClipRange#(Value, LowerLimit, UpperLimit)
 
Parameters:

    Value = The value to clip
    LowerLimit = The lower limit of the range
    UpperLimit = The upper limit of the range
Returns:

    Result# = The clipped value
 

      The ClipRange# function clips the specified float value to within given range. If the value is less than the lower limit, the lower limit is returned. If the value is greater than the upper limit, the upper limit is returned. Otherwise the ClipRange returns the original value.




Mini Tutorial:


      Showing the use of the ClipRange# function

  
; loop
  For i = 1 To 9
     
   ; increase Value# by 0.1
     Value# = Value# + 0.1
     
   ; Use the ClipRange# function
     Print ClipRange#(Value#, 0.30.7)
     
   ; next iteration
  Next i
  
; Display the output on the screen and wait for the user to press a key
  Sync
  WaitKey
  



     This example would output:
  
  0.3
  0.3
  0.3
  0.4
  0.5
  0.6
  0.7
  0.7
  0.7
  






 
Related Info: ClipRange | Range | RndRange | RndRange# :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com