Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-02

compiler asks for variants support

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi,

why does this program:

program novariant;
uses
	sysutils;
var
	a, b: double;
begin
	b := 0.4237;
	a := b**5;
	writeln(floattostr(a));
end.

when running give that error message:

$ ./novariant

Program needs probably the variants unit.
Include the variants unit in your uses statements
as one of the first units.

An unhandled exception occurred at $08052E37 :
EVariantError : Invalid variant operation
$08052E37

TIA,
Marc

Jonas Maebe
to Marc Santhoff
Marc Santhoff wrote 16 lines
why does this program: program novariant; uses sysutils; var a, b: double; begin b := 0.4237; a := b**5; writeln(floattostr(a)); end. when running give that error message:

The ** operator for doubles is declared in the math unit. Without including the math unit, the only found ** operator is for variants.

Jonas

Marc Santhoff
to Jonas Maebe
Jonas Maebe wrote 21 lines
On 17 Feb 2008, at 17:19, Marc Santhoff wrote: > why does this program: > > > program novariant; > uses > sysutils; > var > a, b: double; > begin > b := 0.4237; > a := b**5; > writeln(floattostr(a)); > end. > > > when running give that error message: The ** operator for doubles is declared in the math unit. Without including the math unit, the only found ** operator is for variants.

I see.

Thanks, especially for answering quickly,
Marc