返回Pascal中的值

Clu*_*ess 11 pascal freepascal

对于在Pascal中返回值的函数,FunctionName := SomeVal;使用赋值.我认为它不会像return在C中那样在那个确切的位置停止函数执行.return在Pascal中有类似C的东西吗?(我正在使用FreePascal编译器)

RRU*_*RUZ 13

您可以使用退出程序.

function Foo (Value : integer) : Integer;
begin      
  Exit(Value*2);
  DoSomethingElse();   // This will never execute
end; 
Run Code Online (Sandbox Code Playgroud)