Board index » delphi » Declaring reals HELP!!!!

Declaring reals HELP!!!!

I am a new delphi user and I am not crazy but I cant seem to declare a real
number. It thinks that my variables are Integers when they are declared as
Real.

I get this compilation error :

Integer constant too large.

Here is my source code:

program CLImonitor;
{$APPTYPE CONSOLE} // this is a console application
uses
   Windows;
   {$R *.RES}
var
   a: Real; // see I am declaring a real!!!
begin
     a         := 9999999999;  // any number larger than 2147483647 will
cause the error
     WriteLn('a=', a);
     ReadLn; // press return to close the console
end.

Please help I am desperate!

Mark Dranoff
dran...@fullspectrum.net
dran...@interaccess.net

 

Re:Declaring reals HELP!!!!


var
   a: Real;
begin
     a:= 9999999999.0;
     ShowMessage(FloatToStr(a));
end;

Quote
> var
>    a: Real; // see I am declaring a real!!!
> begin
>      a         := 9999999999;  // any number larger than 2147483647 will
> cause the error
>      WriteLn('a=', a);
>      ReadLn; // press return to close the console
> end.

Other Threads