Results 1 to 5 of 5

Thread: problem with data type

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    39

    problem with data type

    Hi
    I tried to declare avariable tgelephoneNo as an int or long but dose not work when insert a numer like 01992 787878 it said int to large same as for the long, could you please tellme what is wrong

  2. #2
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: problem with data type

    Is there a space, if so it is wrong.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  3. #3
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: problem with data type

    You can't start with 0.

    And also, maximum value of int is 232 - 1. You exceeded that limit in int type.

    In long type use postfix 'L' to indicate it is a long value.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: problem with data type

    Telephone numbers are strings not integers
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  5. #5
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: problem with data type

    Ya, if you want to add it with zero and space, better to make them as Strings.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width