How To Convert a 4 Byte Number In String Form To a Numeric Array

I think I previously posted this in the wrong zone. Sorry for the inconvenience.

Question:

I have 10 digit decimal numbers (4 bytes each) in string form that I need to convert to numeric form so that I can place them in an an array.

My array is declared as:

___________________________________________________________

type
TModemSigArray  = array[0..1499] of dword;

var
ModemSigArray: TModemStatArray;

______________________________________________________

The numbers in string form arrive by an enet port and all are 10 digits long. When I convert using "StrToInt" and place it in the array, the number that is represented in the array is different (smaller) than the original.

My code:

E := StrToInt(1234567890);              //Convert from string to integer
ModemSigArray[IDCounter] := E;      //Load array


The numbers have not exceeded the Integer limitaion of 2,147,483,648. However I have tried using  StrToInt64, converting to Hex (because of the 64 bit limitation), to no avail.

jsmitterSenior Project EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jimyXCommented:
Would you please post the code you used, as the following code works:

type
TModemSigArray  = array[0..1499] of dword;

procedure TForm1.Button1Click(Sender: TObject);
var
  E:integer;
  ModemSigArray: TModemSigArray;
begin
  E := StrToInt('1234567890');
  ModemSigArray[0] := E;
  showmessage(inttostr(ModemSigArray[0]));
end;

Open in new window



>   10 digit decimal numbers...I need to convert to numeric

If your numbers are decimal, you use Float instead of Int.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.