Ken G. Brown wrote:
Mac OS X 10.4.8, gpc 35u2
This is driving me crazy. Why does this snippet give a compile error in the function declaration? error: syntax error before `('
program PrtTst2;
uses GPCStringsAll;
// from the gpc.pdf manual this is the way a function should look // // function function_identifier (parameter list): result type ; // declaration part // begin // statement part // end;
function fixDateYear(thisDate : String(255)) : String(255); begin end;
begin {main} end.
For function parameters and and return type Pascal allows only type _name_. Change your program to:
program PrtTst2;
type String255 = String(255);
function fixDateYear(thisDate : String255) : String255; begin fixDateYear := thisDate end;
begin {main} end.
and gpc will accept it.