What is returned?

mabl4367mabl4367 Member Posts: 143
What is returned by a funktion if the returnvariable has no name and no call to EXIT() is made in the function?

I have a function that returns a boolean with no name. Previously the code included a call to EXIT() that defined whether the value returned sould be true or false. Now that the call to EXIT() has been removed what is returned? Is the returnvalue going ti be always TRUE or always FALSE or maby random?

Answers

  • garakgarak Member Posts: 3,263
    edited 2009-11-24
    A random value :-D :-D that would be funny

    It gives back the initial value of the datatype. On Boolean it is false.

    If the returnvariable has a name like "ReturnBoolVar", an it is set in the function, the exit returns the value of this variable.
    If the returnvariable hasn't a name and in the exit() is nothing set, it's returned the initial value.

    regards
    Do you make it right, it works too!
  • mabl4367mabl4367 Member Posts: 143
    That was what I suspected but I needed confirmation.

    Thank you very much!
  • garakgarak Member Posts: 3,263
    You're welcome
    Do you make it right, it works too!
  • kinekine Member Posts: 12,562
    I will rather wrote that it will return "UNDEFINED" value. That this value is same as default value of the data type is just coincidence. Do not rely on it.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.