* The code doesn’t have to be repeated every time it needs to run * Easier to modify logic, since only the subroutine will need to be edited rather than editing numerous places in the code
2
New cards
Local variables
Are only useable within that part of the code. Eg a local variable in a subroutine cannot be used in the main code
3
New cards
Function
Similar to a subroutine but returns a value, (parameters for that value are in brackets next to function)
4
New cards
arrays
* have to contain the same data type * Fixed size (so data cannot be added)
5
New cards
Records
* Can have multiple data types * Can have data added to it
\
6
New cards
Parameter
Is a way of passing a value to a subroutine
7
New cards
Return
In a function this value can be returned, usually something has to be done with it or it is stored in the main code.