EXIT function

Hi, I’ve recently started working with Navision. I’ve used a lot of effort trying to find manuals and books on programming Navision. Seems like there is not much to cling to. I would appreciate any pointers to such sources. The question is; What is the syntax for the Exit-function? I mean sometimes there are parameters or calculations used with it. For some reason I can’t find this in the C/AL Reference. /Pauli

Pauli If you set a return type on a Function you exit with a value IE: EXIT(WORKDATE); // Returns a Date EXIT(“Document No.”); Returns Code 20 Example from CodeUnit 1 which returns an Integer IF Position > Length THEN BEGIN DateText := FORMAT(Date); EXIT(0); END; EXIT(Position); David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk Edited by - David Cox on 2001 May 09 17:30:07

Thanks David, this should have been obvious but… I was just too much looking for “Return” or VB like “Function = value”. /Pauli

You can do that to. You can set your return variable to have a name and then setting this value before exit. i.e. Return_Variable := ‘VALUE’; EXIT; instead of EXIT(‘VALUE’); I know its more code but it does sometimes come in useful to do things that way. Paul Baxter