Sunday, July 30, 2017

Count Number of Eight Digits in Visual Basic 6

A simple program that will ask the user to give a series of numbers in integer format. Our program will count the number of eight digit occurrence based on the given number by our user. The code is written in Visual Basic 6 and it is very easy to understand.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Thank you.








Sample Program Output


Program Listing

Function CountChar(ByVal Text As String, ByVal Char As String) As Long
    Dim V As Variant
    V = Split(Text, Char)
    CountChar = UBound(V)
End Function


Private Sub Command1_Click()
Label1.Caption = "The Number of 8 Digits in the given number is " & CountChar(Text1.Text, "8") & "."
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Label1.Caption = ""
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub

No comments:

Post a Comment