Jump to content
Mr. Victor Bolbot

How to write a function in a feature that returns a number?

Recommended Posts

Hi,

 

I would like to write a feature and for better controling of the process, I would like to use functions that return as result a number. The value of the number is necessary for further calculations. 

 

Regards,

 

Victor 

Share this post


Link to post
Share on other sites

Hi,

 

the basic syntax for a function is:

function <functionName>(<argumentList>) [: <returnType> ]
  // function body
endfunction

So if you want to return a double, a function could look like this:

function answerToEverything() : FDouble
  return(42)
endfunction

Regards,

Arne

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...