Sign in Join

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

Mailing lists / fpc-pascal / 2006-11

Program needs probably the variants unit

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Jan Jelowicki

Hello,

I wrote accidentally the following line of pascal code:

   writeln(output, a + b);

where a was a double, and b was a string. The program compiled, linked successfully. Why?

Next, running it, I got the following:
[code]
Program needs probably the variants unit.
Include the variants unit in your uses statements
as one of the first units.

Runtime error 221 at $08053F3A
$08053F3A
$BFFFEE98
[/code]

Well. But I do not like programs that try to be more intelligent than operator. double + string expression is lexical error from my point of view, and always will be. I would prefer to detect them during compilation. What switches could enable that?
-So is always on
-S2 has no influence
-Sd has no influence

With regards,
Jan Je/lowicki

----------------------------------------------------------------- Department of Mathematics Katedra Matematyki University of Agriculture Akademia Rolnicza we Wroc/lawiu Wroc/law, POLAND
-----------------------------------------------------------------