Please enable JavaScript.
Coggle requires JavaScript to display documents.
Procedures and functions (Benefits of using procedures and functions…
Procedures and functions
-
A function only returns a single value but also consists of a heading a declaration part and an action part
A procedure produces an effect which is activated by a call from the main program. It consists of a heading, a declaration part and an action part
A local variable exists within one subroutine, function, or procedure.
-
-
-
A global variable can be accessed and altered from any part of the program, even from another script/event so long as it is declared at the very start.
These should be used with care as their values may accidentally change if the programmer forgets that they have already used them in another subroutine
A formal parameter is used as a placeholder within a subprogram for the values received or sent to the main program’s actual parameters.
-
-
-
-
-