Difference between revisions of "Creating a New Macro"

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
 
<sidebar>Sidebar: What Is a Macro?</sidebar>
 
<sidebar>Sidebar: What Is a Macro?</sidebar>
Select the 'New' option from the 'Macro' menu or press '''Ctrl+M''' to create a new macro.
+
Select the 'New' option from the 'Macro' menu or press '''Ctrl+M''' to create a new macro. You can also create a new macro using the 'Macros' section of the [[Project Explorer]] by clicking the arrow next to the 'Macro' item to open up a menu, then selecting 'Add new' from the menu.  
  
You can also create a new macro using the 'Macros' section of the [[Project Explorer]] by clicking the arrow next to the 'Macro' item to open up a menu, then selecting 'Add new' from the menu. Once the macro has been created it will appear in the list of the 'Macros' section, here you can also add local variables and constants as well as parameters if you did not do so earlier, you can also delete existing local variables, constants and parameters.
+
Your created macros will be displayed in a list in 'Macros' section of the Project Explorer, here you can add new local variables and constants as well as parameters if you did not do so earlier, you can also delete or edit existing local variables, constants and parameters.
  
  

Revision as of 11:00, 27 August 2013

<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 using the 'Macros' section of the Project Explorer by clicking the arrow next to the 'Macro' item to open up a menu, then selecting 'Add new' from the menu.

Your created macros will be displayed in a list in 'Macros' section of the Project Explorer, here you can add new local variables and constants as well as parameters if you did not do so earlier, you can also delete or edit existing local variables, constants and parameters.


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}}