Factorial – The factorial of a number
‘ The factorial of a number” if NUMBER is negative or >170 it raises an’ “subscript out of range” errorFunction Factorial(ByVal number As Long) As Double Static result(170) As Double
‘ The factorial of a number” if NUMBER is negative or >170 it raises an’ “subscript out of range” errorFunction Factorial(ByVal number As Long) As Double Static result(170) As Double
‘ number of Combinations of N objects in groups of M” Note: requires the FACTORIAL routineFunction Combinations(ByVal Objects As Long, ByVal GroupSize As Long) As Double Combinations = (Factorial(Objects) /
‘ number of permutations of N objects in groups of M” Note: requires the FACTORIAL routineFunction Permutations(ByVal Objects As Long, ByVal GroupSize As Long) As Double Permutations = Factorial(Objects) /
‘ Base 10 logarithmFunction Log10(number As Double) As Double Log10 = Log(number) / 2.30258509299405End Function
‘ The fractional part of a floating-point number’ note that negative numbers return negative valuesFunction Fract(number As Variant) As Variant Fract = number – Fix(number)End Function
‘ Return True if the number is primeFunction IsPrime(ByVal number As Long) As Boolean ‘ manually test 2 and 3 If number > 3 Then If number Mod 2 =
‘ A random number in the range (low, high)Function Rnd2(low As Single, high As Single) As Single Rnd2 = Rnd * (high – low) + lowEnd Function
Question: I would like to display a “Quote of the Day.” In order to do this, I need to retrieve the numbers of records in a recordset and then randomly
Question: Using VBScript, how can I use the @@Identity SQL Statement to set the keyfield of a record just entered to a variable? Answer: You can issue multiple SQL statements