# 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

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.

###### Who is Participating?

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.

Commented:
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;
``````

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