Creating a New Macro

From Flowcode Help
Revision as of 10:35, 27 August 2013 by ReeceL (talk | contribs)
Jump to navigationJump to search

<sidebar>Sidebar: What Is a Macro?</sidebar> Select the 'New' option from the Macro Menu or press Ctrl+M to create a new macro. You can also create a new macro through the Project Explorer.


The Macro dialog will appear with the following sections for filling in information, and adding options:

Gen Creating a New Macro 01.png

Name

Enter a name for the macro. If the name that you enter for the new macro already exists, then Flowcode will prompt you for a different name.


Description

Enter a description of the macro and its functions.


Parameters

Adds a list of parameters that are required to be supplied to the macro.

Set the Name and type of the parameters.

Parameters can be added, edited or deleted.


Variables

Adds a list of variables that are required to be used by the macro.


Constants

Add, edit and delete constants which are only available to the selected macro.


Return type

Specify the return type, or "No return variable" if the macro does not return a value.


Private Flag

When creating a new macro for a component using the customized code feature you will be given a tick box allowing the macro to be private. If the macro is set to be private then the macro will not appear in the main Flowcode component macro list. This is useful for creating invisible helper functions such as the LCD RawSend function.


Video instructions

See the Adding Macros video for information on creating a macro, the video shows the creation of a macro in a practical manner which covers the available functionality such as adding a parameter to the macro as well as creating a variable whilst also differentiating from global and local variables and constants.

{{#ev:youtube|5Z3zbVR7ZZY|640}}