Showing posts with label palindrome number in vb. Show all posts
Showing posts with label palindrome number in vb. Show all posts

Saturday, January 20, 2018

Palindrome Number Checker in Visual Basic

Here is another version of Palindrome Number Checker that I wrote using Microsoft Visual Basic 5. It will ask the user to give a number and then our program will check and determine if the given number is Palindrome or Not a Palindrome. The code is much compatible in Visual Basic for Application with little modification kindly see the Microsoft Access version of this code.

I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.

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

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.







Sample Program Output


Program Listing

'Palindrome Number Checker in Visual Basic 5
'Written By Mr. Jake R. Pomperada, MAED-IT
'January 20, 2018 Saturday
'Bacolod City, Negros Occidental Philippines
'jakerpomperada@yahoo.com and jakerpomperada@gmail.com

   Public Function CheckNumberPalindrome(value_input) As Integer
    Dim n, r, sum, t As Integer
        n = value_input
        sum = 0
        t = n
        While n <> 0
            r = n Mod 10
            sum = sum * 10 + r
            n = n \ 10
       Wend
       
       If sum = t Then
   
     Label2.Caption = "The given number " + Str(value_input) + " is a Palindrome Number."
    Else
  Label2.Caption = "The given number " + Str(value_input) + " is Not a Palindrome Number."
End If
End Function

Private Sub Command1_Click()
Dim a As Integer
   

If Len(Trim(Text1.Text) & vbNullString) = 0 Then
     MsgBox "Enter the a Number", vbInformation
     Text1.Text = ""
     Text1.SetFocus
     Exit Sub
End If

a = Val(Text1.Text)

CheckNumberPalindrome (a)
End Sub

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