Returning values from functions

david.weeksdavid.weeks Member Posts: 96
edited 2004-05-09 in Navision Attain
Hello All

I have created a function where i pass two fields into this.
Once I have performed some calculations within the function, I want to send back a boolean variable that I will set within the function.

How do I access this variable?
i.e. I see there is a return value section when setting up the function but how does it work?

Thanks

Comments

  • FPulsfortFPulsfort Member Posts: 43
    Hi,

    You have three fields:
    "return type" and "length" set the type of the returnvalue.

    if you use the field "name" (e.g. RetVal) then you can assign the field a value as variable: Retval := TRUE; or RetVal := 'Hello';

    if you leave the field "name " empty, then you can use the returnvalue with EXIT(TRUE); or EXIT('Hello');

    Hope this helps,
    Frank
  • RobertMoRobertMo Member Posts: 484
    And you call a function like this:
    bMyResult := MyFunction(parm1,parm2);

    If you ever need to return more then one result, you can use a parameter called by ref. (VAR=Yes on parameters definition).

    This way all changes that are done to this parameter are visible outside function.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Sign In or Register to comment.