Please enable JavaScript.
Coggle requires JavaScript to display documents.
Procedures and Function (Local Variables (exists within one subroutine,…
Procedures and Function
-
Procedures
contains a heading, declaration part and an action part
-
when a procedure is called, it produces an effect
Functions
contains a heading, declaration part and an action part
-
when a function is called, it returns a single value
-
Local Variables
exists within one subroutine, function or procedure
-
-
-
-
Global Variables
can be accessed and altered from any part of the program (even from another script/event as long as it is declared at the very start)
values are easily accidentally changed if the programmer forgets that they have already used them in another subroutine
-
Formal Parameter
used as a placeholder within a subprogram for the values received or sent to the main program's actual parameters
-
By Reference
-
the subroutine will be passes the original parameter and any changes made in the subroutine will result in a change to the original value held within the parameter
By Value
-
the subroutine will pass a copy of the original parameter, so the original parameter is unchanged