Return value to Pascal

For a function that returns a value in Pascal, the assignment is FunctionName := SomeVal; . I assume that this does not stop the function from executing in this exact place, like return in C. Something like C return in Pascal? (I am using the FreePascal compiler)

+8
pascal freepascal
source share
1 answer

You can use the Exit procedure.

 function Foo (Value : integer) : Integer; begin Exit(Value*2); DoSomethingElse(); // This will never execute end; 
+10
source share

All Articles