Function Basic Extensions Class

BeepEveryNthCall

Function Beeps every Nth time that it is called. For example, beep once every 500 times that the function is called.

Signature (Visual Basic / VBA)

Public Function BeepEveryNthCall( _
    Optional ByVal vNthCall As Long = 0 _
    ) As Boolean

Code Example

    ' Should beep 20 times.
    Dim lngCur As Long
    For lngCur = 1 To 10000
       Dim varIgnore As Variant
       varIgnore = BeepEveryNthCall(500)
       Dim dblTemp As Double
       dblTemp = Sqr(lngCur)
    Next lngCur

Parameters

Parameter Description
vNthCall The number of calls to this function before the function beeps. vNthCall defaults to 0 (zero) if it is missing.

Return Value

Function returns True if vNthCall is >= 0 (greater than or equal to zero) and it returns False otherwise.

Notes & Version History

v1.3 Change Changed the name of the argument, changed its datatype from Variant to Long, and specified a default value for it.