Functions can be stored and included in the code of any CDF file.
- Place the package where Wolfram Player can find it. If the package is used only by a specific CDF file, place it in the same folder as your CDF file. If you would like to reuse the package, place it in the Wolfram Player’s apps folder:
In either case, note the folder in which you have placed the CDF package.
- Load the package inside the Initialization option for the Manipulate or DynamicModule, providing its complete path:
Where “PathToPackage” is the folder from Step 1.
- When calling functions from the package, provide the context of the function, which is the package name. For example, to use myfunc from package mypackage.wl, use the following code: