Difference between revisions of "Macro Icon Properties"

From Flowcode Help
Jump to navigationJump to search
Line 47: Line 47:
  
 
If the device macro returns a value then you can assign that value to an existing variable for use later in the flowchart. If the function returns a value but you do not wish to retrieve it then leave this field empty.
 
If the device macro returns a value then you can assign that value to an existing variable for use later in the flowchart. If the function returns a value but you do not wish to retrieve it then leave this field empty.
The variable type of the return value will be listed. A variable of the specified type must be used to accept the return value.
+
The [[Variable Types|variable type]] of the return value will be listed. A variable of the specified type must be used to accept the return value.
  
  
 
'''Create New Macro button'''
 
'''Create New Macro button'''
  
Select this button to create a new macro within the flowchart.
+
Select this button to [[Creating a New Macro|create a new macro]] within the flowchart.
  
  
Line 58: Line 58:
  
 
Clicking this button will open up the chosen macro to allow it to be viewed or edited.
 
Clicking this button will open up the chosen macro to allow it to be viewed or edited.
 
 
'''Creating new macros'''
 
 
Clicking the Create new macro button brings up the new macro dialog.
 
See Creating new macros for more information
 

Revision as of 14:06, 18 June 2013

<sidebar>Sidebar: Icon Properties</sidebar> Btn Macro.gifFile:Gen Macro Icon Properties Macro Flowchart Icon.pngFile:Gen Macro Icon Properties Macro Properties.png


Macros are split into Macros and Component macros.


Component macros are pre-defined macros supplied with the components. For example LCD macros are used to display numbers and characters on the LCD display. Component macros are only available for use with that particular component. Component macros have hatched outer bands on the icon.


Macros (explained here) are those designed and created by the user. Macros can be exported and imported allowing users to build up macro libraries of common or important tasks. On Macros the outer bands are clear and not hatched.


Macros

Macros are sections of code, that can be used and reused in projects.

Macros allow complex tasks to be handled by code blocks and they can be imported and exported.


The macro properties dialog allows users to select and create macros.


Adding a Macro

Select the Macro to use from the list, or click on Create new macro to begin creating a new macro to add to the list. Add in any parameters required, and select a return value if required.


Clicking on the OK button completes the process and closes the dialog.

Clicking on the OK and edit button completes the process, closes the dialog and opens the selected macro for editing.


Parameters

If the device macro requires any parameters then these can be entered in this field. They can be numeric values or existing variables. Clicking on the down arrow allows you to select an existing variable or to create a new one. The parameter details will list the parameter type. Parameters must be of the required type to be accepted. Note that a full set of parameters must be provided.


Return value

If the device macro returns a value then you can assign that value to an existing variable for use later in the flowchart. If the function returns a value but you do not wish to retrieve it then leave this field empty. The variable type of the return value will be listed. A variable of the specified type must be used to accept the return value.


Create New Macro button

Select this button to create a new macro within the flowchart.


OK & Edit Macro button

Clicking this button will open up the chosen macro to allow it to be viewed or edited.