I am frustrated by a very simple problem. I am trying to convert real to integer, using free pascal for mac. I am an old Think Pascal user who just recently found free pascal and, while thrilled to have a pascal compiler for mac OSX, I am still a bit lost. In Think Pascal, I would have just used "round", but this doesn't seem to work.

x : integer;
y : real;

x := round(y);

gives me an error saying "got "Double" expected "SmallInt"". This occurs no matter how I define x: integer, smallint, etc. In fact, if I set x to real, then the program compiles and works, simply converting decimal values to 0 but not deleting them.

I suspect I am making some simple error.  Any advice?
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to