Difference between revisions of "Mixly Block Category - Factory"
(→Call Member Function of a Variable) |
(→With Parameter(s)) |
||
Line 27: | Line 27: | ||
*'''student_name . length''' will return the number of characters in '''student_name''' | *'''student_name . length''' will return the number of characters in '''student_name''' | ||
==With Parameter(s)== | ==With Parameter(s)== | ||
+ | Parameters or Input Variables can be passed to the member function. This can be configured with the '''gear''' icon on the block. Drag to remove or add inputs. | ||
=Call Static Function of a Class= | =Call Static Function of a Class= |
Revision as of 19:42, 28 February 2017
Contents
Include a Library
This block includes a library. A library is a file that contains code for functionality.
- Library Name - the name of the Library file. Usually the class name.
Read more here: https://www.arduino.cc/en/reference/libraries
Call a Function with Parameter(s)
This calls a Function / Procedure with parameter(s) or without. The number of parameters is configurable using the gear icon. There are two variants, one that has no return value and one that expects a return value.
- Function Name - the name of the Function / Procedure to be called.
- Parameters / Input Variables - variables, statements or constants that will be passed to the Function / Procedure.
Declare a Variable with a Type
This block allows the declaration of variables.
- Data Type - the type of Data Type for the variable being declared.
- Variable Name - the name of the variable being declared.
Read more here: https://www.arduino.cc/en/Reference/VariableDeclaration
Call Member Function of a Variable
Some Data Types have member functions. Member functions are functions that are acted upon the variable of Data Type.
Example:
- Data Type of String has a member function length. Which returns the number of characters in a String variable.
- Variable student_name of type String
- student_name . length will return the number of characters in student_name
With Parameter(s)
Parameters or Input Variables can be passed to the member function. This can be configured with the gear icon on the block. Drag to remove or add inputs.