?
Solved

Converting to Integer Problems

Posted on 1998-02-24
2
Medium Priority
?
278 Views
Last Modified: 2010-04-06
I am having problems converting a string value in a table to an integer.    An example is listed below.

   Note: psoc is defined as an integer.
         Table2's er_ssn is defined as a string.

psoc :=table2.FieldByName('er_ssn').asinteger;

Later I insert the value of psoc in a table and get...

psoc => -32324

if I do...
label1.capton :=table2.FieldByName('er_ssn').asstring;

I get ...
label1.caption => 006521276  (Which is the correct Number)

How do I populate the new table with the correct integer value???

   P.S.  I have changed the 'picture' property in the new table to display unsigned integer... But I still get -32324?

What do I do now....
0
Comment
Question by:pepe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:pepe
ID: 1359749
Edited text of question
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1359750
You get this error, because integer types can't  contain such high values, these are the ranges.

SmallInt      -32768 .. 32767      Signed 16-bit

Longint      -2147483648 .. 2147483647      Signed 32-bit

What if you change the field to type LongInt, Cardinal? Or you have to go to real values. Also psoc has to be such a type!!



0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question