Sign in Join

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

Mailing lists / fpc-pascal / 2003-02

1.0.6 problem

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

James Mills

Hi all,

I just recently upgraded to FPC 1.0.6 (Debian testing-SID), one of my programs now doesn't compile because of this error.

functions.pas(42,2) Error: Incompatible types: got "<unknown type>" expected "<procedure variable type of function(PSTRING,LONGINT):AnsiString;>"

Here is the source pertaining to it:

{ Function Declarations }
function SignOf(args: pString; argCount: longInt): String;
function GetTimeOf(args: pString; argCount: longInt): String;
function TimeStamp(args: pString; argCount: longInt): String;
function Rnd(args: pString; argCount: longInt): String;
function AbsOf(args: pString; argCount: longInt): String;
function Ans(args: pString; argCount: longInt): String;
function Pow(args: pString; argCount: longInt): String;
function Duration(args: pString; argCount: longInt): String;
function Len(args: pString; argCount: longInt): String;
function Sigma(args: pString; argCount: longInt): String;
function IntOf(args: pString; argCount: longInt): String;
function FracOf(args: pString; argCount: longInt): String;
function nPr(args: pString; argCount: longInt): String;
function nCr(args: pString; argCount: longInt): String;
function getPI(args: pString; argCount: longInt): String;
function e(args: pString; argCount: longInt): String;
function sine(args: pString; argCount: longInt): String;
function cosine(args: pString; argCount: longInt): String;
function tangent(args: pString; argCount: longInt): String;
function arcsine(args: pString; argCount: longInt): String;
function arctangent(args: pString; argCount: longInt): String;
function Modulas(args: pString; argCount: longInt): String;
function SqrRoot(args: pString; argCount: longInt): String;
function RoundNumber(args: pString; argCount: longInt): String;
function TruncateNumber(args: pString; argCount: longInt): String;
function Radians(args: pString; argCount: longInt): String;
function Degrees(args: pString; argCount: longInt): String;
const NumFunctions = 27;

const FunctionsTable: Array[0..(NumFunctions - 1)] of function(args: pString; argCount: longInt): String = (
SignOf,
GetTimeOf,
TimeStamp,
Rnd,
AbsOf,
Ans,
Pow,
Duration,
Len,
Sigma,
IntOf,
FracOf,
nPr,
nCr,
getPI,
e,
sine,
cosine,
tangent,
arcsine,
arctangent,
Modulas,
SqrRoot,
RoundNumber,
TruncateNumber,
Radians,
Degrees
);

Could someone help me out here please, as it did compile with 1.0.4

thank you :)

James

Jonas Maebe
to James Mills
James Mills wrote 6 lines
I just recently upgraded to FPC 1.0.6 (Debian testing-SID), one of my programs now doesn't compile because of this error. functions.pas(42,2) Error: Incompatible types: got "<unknown type>" expected "<procedure variable type of function(PSTRING,LONGINT):AnsiString;>"

The reason that it compiled in 1.0.4, was a bug in that version of the compiler. You can compile this code as-is in TP or Delphi mode. In FPC or ObjFPC mode, you have to add an "@" in front of the procedure names to get their addresses. In version 1.0.4, this extra @ in FPC mode was already enforced in normal code, but not in typed constants. This inconsistency was fixed in 1.0.6.

Jonas

James Mills
to Jonas Maebe
Jonas Maebe wrote 16 lines
On maandag, feb 3, 2003, at 13:24 Europe/Brussels, James Mills wrote: >I just recently upgraded to FPC 1.0.6 (Debian testing-SID), one of my >programs now doesn't compile because of this error. > >functions.pas(42,2) Error: Incompatible types: got "<unknown type>" >expected "<procedure variable type of >function(PSTRING,LONGINT):AnsiString;>" The reason that it compiled in 1.0.4, was a bug in that version of the compiler. You can compile this code as-is in TP or Delphi mode. In FPC or ObjFPC mode, you have to add an "@" in front of the procedure names to get their addresses. In version 1.0.4, this extra @ in FPC mode was already enforced in normal code, but not in typed constants. This inconsistency was fixed in 1.0.6.

Ok thank you. I know it was inconsistant in 1.0.4, but ignored it as it did compile properly ;) I would have spent ages figuring this out had you not said it was an inconsistancy with 1.0.4. Thank you.

cheers
James

Show quoted text 7 lines
Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal