Functions

Introduction to Functions in Flowata

At the heart of any programming or scripting language lies its functions. Functions are reusable blocks of code that perform specific tasks, encapsulating logic and behavior. They allow for modular, organized, and efficient coding, enabling developers to avoid repetitive code and create more maintainable and readable scripts.

In Flowata, functions play a pivotal role in bringing your formulas to life. Whether you're performing arithmetic operations, manipulating strings, or controlling the flow of execution, functions are your primary tool. They provide structure to your code and allow you to harness the full power of the Flowata language.

Flowata offers a rich set of built-in functions designed to cater to a wide range of needs. These functions are optimized for performance and versatility, ensuring that you have the right tools at your disposal for any task. As you delve deeper into this section, you'll discover the variety and capabilities of Flowata's built-in functions. Whether you're a beginner just starting out or an experienced developer looking for advanced functionalities, Flowata's functions are designed to empower and simplify your coding journey.

Using Functions in Flowata

Flowata's syntax is designed to be intuitive and user-friendly. When invoking multiple functions, they are separated by a semicolon (;). However, if your formula consists of a single expression or return value without any additional function calls, the semicolon is optional.

For example:

print(add(2, 3)); print(multiply(4, 5))

This would first add 2 and 3, then multiply 4 and 5. Each function call is distinct and separated by the semicolon.

Function Categories:

Control Flow Expressions

Grasp the expressions that dictate the flow of your formulas. Understand how to use conditional logic, loops, and other mechanisms to guide the execution of your code.

Built-in Functions

Explore the core functions that empower Flowata's versatility. Dive into the array of functions provided out-of-the-box, from arithmetic operations to string manipulations and more.

User-Defined Functions and Classes

Discover how to craft your own functions and classes to extend Flowata's capabilities. Learn how to encapsulate custom logic and behaviors, making your formulas even more powerful.