Putting code into packages
Runtime packages are another way to share code and are used far more frequently than dynamic libraries as these are available on all platforms and are the basis of components—which we will cover in the next section. Packages are simpler to write than dynamic libraries because they don't have the parameter-passing issues to worry about, and functions and objects can be called and passed around just as if the code were part of the project. But they can only be used by Delphi packages and applications written in the same version of Delphi that is used to compile the package.
Note
You also need to know how to write packages to use RAD Server (Enterprise or Architect edition).
Let's turn our HideString
library into a package. This actually involves taking out some of the scaffolding code we put in to support a dynamic library. In fact, when we're done, it simply looks like a collection of used units we'd link directly in the...