[fpc-pascal] different windows/linux behavior with enumerated types and write/writeln

Seth Grover sethdgrover at gmail.com
Wed Jan 20 20:07:00 CET 2010


If I have a program like this:

------------------------------------------------------
program Project1;

{$mode objfpc}{$H+}

type
  whatever = (seth, paul, ken);
var
  haha : whatever;
begin
  haha := seth;
  writeln(haha);
end.
------------------------------------------------------

I can compile it in linux with FPC and run it and get the following output:

------------------------------------------------------
$ ./project1
seth
------------------------------------------------------

In other words, it actually prints out the name of the enumerated value.

In windows the program does not compile with an error of "Error: Can't
read or write variables of this type".

Why the difference in behavior?

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
sethdgrover[at]gmail[dot]com



More information about the fpc-pascal mailing list