Solved

Converting to Integer Problems

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now