Exit statement Resurrection

Howdy, who did close this subject? In my opinion you’ll get far off if you use the Navision Exit statement as a replacement for the “standard” Pascal variable Return. The critical difference is, that the Exit statement breaks program flow, and gives you a shortcut to jumping out of a function. The Return variable, in standard Pascal, has no such functionality, but merely acts as a nickname for the function return parameter. Pelle

Ok, i closed the topic - as it seemed to have concluded what it needed too :-). But Pelle you are right, using EXIT stops further execution in a function, whereas the assignment doesn’t. This is ofcourse important to be aware of - but I surely hope that every person that passed the Solution Developer course is aware of this! Thanks for the input. Soren Nielsen, moderator Integration/Developer NOLUG

I don’t really see anything extrange in Navision’s EXIT command working… you should think not only in Pascal, but other languajes… and exit functionality in Navision is exactly the same as in C, C++ or Java, so i can’t understand why people is so stranged about how it’s working… :slight_smile: Functions returning values in Navision can do it in some ways: a) by passing a Var parameter and modifying it with the value. b) by defining the returning variable and modifying it’s value with the result. c) by using exit(value) function. Methods a and b are really similar ones (the difference is that you don’t need to pass a variable as parameter for returning the result). Method c is almost as method b, but it terminates execution of the function. – Alfonso Pertierra apertierra@teleline.es Spain