symmetrical number- palindrome - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

symmetrical number- palindrome

Hi :)
I'm using delphi 7. I'm trying to make a progamme where i could check if number is palindrome (symmetrical ... for example 123 -isnt palindrome 2345432 - is palindrome).... (number input in edit1) and label say me (for example) 'yes this number is palindrome !' or 'no this number isnt palindrome') ... what i need is one edit, one button(all commands) and label ... this isnt hard to do (i know) but i am amateur and i need it a lot :) thx and sorry for my english... what i need is complete command for it .... muhuhee

Comments

  • DWDuckDWDuck Posts: 31Member
    The following function will help:

    Function ISPolindrome(Num:Integer): Boolean;
    Var
    J : Integer;
    Str1,Str2,Str3 : String;

    Begin
    Str(Str1,Num);
    Str2 := Copy(Str1,1,Length(Str1) div 2);
    Delete(Str1,1,Length(Str1) div 2);
    If Length(Str1)<>Length(Str2) then
    Begin
    Str3 := Str1[1];
    Delete(Str1,1,1);
    End;
    If Str1 = Str2 then
    TmpValue = True else TmpValue := False;

    IsPolinDrome = TmpValue;
    End;
    Darkwing Duck aka DWduck signing off :)
Sign In or Register to comment.