Documentation

Learn how to use FlowCanvas

Custom Functions

Another category within the Functions main category is the Custom Functions. Custom Functions are a great way to create reusable logic within a flowScript. You first need to start by creating a Custom Function, through the menu “Functions/Custom/New Custom Function”. Custom Functions can have any number of parameters as well as an optional return value.

CustomFunctionInspector

Once a custom function node has been created (and probably given a good name as well), a new entry in the nodes menu will be made under the “Functions/Custom” category, which will show up your custom function name. That new node (your custom function) can then be used to call the implementation of the custom function from anywhere within the flowScript. Following is a simple example of usage.

CustomFunctions

Custom functions can also be called from within other custom functions. They are furthermore able to be latent, meaning that they can delay their return if for example you are using a Wait node within! Following is an example where the “main program”, is calling Function A with an integer parameter (‘number’). Function A is then adding 1 to that parameter after 1 second delay and calls Function B with the resulting number (2) and returns Function’s B result. Function B is also adding 1 to number parameter and returns the new result (3). The “main program” Function A call final result is 3.

Yes No Suggest edit
7 of 7 users found this section helpful
Suggest Edit

© Paradox Notion 2015-2024. All rights reserved.