Predefined processes, often called procedures or functions, are the core of many programming languages. They allow you to do so much more, than just a standard set of commands.
These are the same time of predefined processes that we would find in a flowchart. We are just going to show them a little different in pseudocode. However, just like in a flowchart, we might pass values to them, as well as get a value from them.
They can come from a variety of places, such as:
- something built into a language, like a random number generator,
- come from an external source like a vendor, or 3rd party website,
- come from another member on your team, or
- it maybe something you create to better organize your code.
Calling a Predefined Process
Typically, I like to use a keyword like call
to let someone know that the command is a predefined process, and that it’s not a simple command.
call processFile()
Notice the parentheses ()
that are after the predefined process name. This is where optional values can be sent to the process if needed, so that it can do more.
call processFile("data.dat")
If you need more than one value sent, you separate them by commas. Quotes are only needed if the value is a string, i.e. not numeric, and exactly what you see.
If you want to return a value, you will give the variable =
and then your predefined process.
call value = getTotalSales()
Predefined Procedures in Psuedocode was originally found on Access 2 Learn