To create a function use the New command.
The New function dialog is displayed:

Developing with Processes and Functions in the Developer Guide
Processes and Functions in the Technical Reference Guide
2.4 Functions