|
-
Jul 3rd, 2007, 07:14 PM
#1
Thread Starter
Member
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
-
Jul 4th, 2007, 12:42 AM
#2
PowerPoster
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
-
Jul 4th, 2007, 01:02 AM
#3
PowerPoster
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
-
Jul 4th, 2007, 03:21 AM
#4
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
-
Jul 4th, 2007, 09:31 PM
#5
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|