You can use the AppWizard to generate a static lib project.
Write a function in it as you normally do.
When compiling it generates a lib. Then you'd link to that lib in your calling application.
Project -> Settings... -> Link Object/Library modules.
Note that you can have more than one project in your workspace. In this case it'd perhaps make sense to have both the lib project and the calling project in the same workspace (though you dont HAVE to), mainly because it's convenient to switch between the two. Besides, of you also set the dependecies (Project->Dependencies) so that the calling project depends on the lib, the calling project will be re-compiled if your lib is changed.
/Per
"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."