IOW yes, the last one is the final result. What that means, however, is that you can use result internally as a local variable to perform calculations inside a function.
function UseResult(const s:string):string;
begin
Result := s; // use result as an internal local variable
Result := Upcase(s); //final result
end;
But with const strings it is dangerous
When you call the function with anotherstring := UseResult(anotherstring), s and result become the same variable. Modifying one might change the other
Start with result := s; and then never use s again
Btw: actually Exit() is a bit under-used while it was always there, so other readers may pick it up too as a useful programming tool.
I had to remove my uses of exit(), when I wanted to compile something with Delphi 4