Solved

Converting to Integer Problems

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
code issue 8 188
delphi parse string to params 3 157
Why can't I create any project with my delphi EXE file? 6 45
Performance of SQL statement 37 137
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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