factorial function
Public Function Factorial(ByVal Factor As Byte) As Variant
On Error GoTo ErrorHandler
If Factor = 0 Then
Factorial = 1
Else
Factorial = Factor * Factorial(Factor - 1)
End If
Exit Function
ErrorHandler:
MsgBox Err.Description
End Function
Private Sub Form_Load()
MsgBox Factorial(3)
End Sub
Related posts:
- delete a folder Dim strDir As String Private Sub Command1_Click() On Error GoTo...
- get drive serial number Private Const MAX_FILENAME_LEN = 256 Private Declare Function GetVolumeInformation& Lib...
- circular form Private Declare Function CreateEllipticRgn Lib “gdi32″ (ByVal X1 As Long,...
- Get drive volume information Private Declare Function GetVolumeInformation Lib “kernel32″ Alias “GetVolumeInformationA” (ByVal lpRootPathName...
- check whether you can play audio files Private Declare Function waveOutGetNumDevs Lib “winmm.dll” () As Long Private...
Related posts brought to you by Yet Another Related Posts Plugin.



















































Post a comment