Solved

Converting to Integer Problems

Posted on 1998-02-24
2
274 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
2 Comments
 

Author Comment

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

Accepted Solution

by:
ZifNab earned 100 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi: how to send PJL commands to printer 3 98
find a node in VST 2 68
How to renew a Delphi rad-studio licence? 5 64
Press three keys together and trigger a function 3 56
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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