RAPID
  • Introduction
  • Quick start
  • Resources
    • Debugging
    • Compiler
    • Rapid CLI
    • Project structure
  • Language
    • Types [proposal]
    • Variables [proposal]
    • Functions
  • Sources
    • Github
Powered by GitBook
On this page
  • Example
  • Return statement
  • Definition

Was this helpful?

  1. Language

Functions

Example

This is the simplest function which is named example, takes no parameters and returns a number of type int.

function example(): int {
  return 12
}

Return statement

Return statement consists of return keyword and an expression.

Supported expression types:

  • number

Definition

function <name>(<param1>: <param_type>, ...): <return_type> {
  return <expression>
}

If function return type is specified as void then return statement is obsolete.

PreviousVariables [proposal]

Last updated 5 years ago

Was this helpful?