Pascal Syntax Error
问题 I have the following function in my program: function Getrand(rStart,rEnd:Integer): Integer; var diff: Integer; begin diff := rEnd - rStart; Getrand := Random(diff) + rStart; end; When I try to compile the program, I get this error: Failed when compiling Line 27: [Error] (27:9): Invalid number of parameters in script What am I doing wrong? 回答1: Perhaps your flavour of Pascal doesn't support the traditional return value syntax. Try Result := … instead of Getrand := … . 回答2: you can use Exit