Difference between revisions of "User Libraries"
m (stray )) |
|||
(9 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Analytica User Guide]] | [[Category:Analytica User Guide]] | ||
[[Category: Functions]] | [[Category: Functions]] | ||
− | <breadcrumbs>Analytica User Guide > | + | <breadcrumbs>Analytica User Guide > User-defined Functions and Libraries > {{PAGENAME}}</breadcrumbs><br /> |
When you place functions and variables in a library, the library becomes available as an extension to the system libraries. Its functions and variables also become available. | When you place functions and variables in a library, the library becomes available as an extension to the system libraries. Its functions and variables also become available. | ||
− | There are two types of user libraries | + | There are two types of user libraries: |
* A library [[File:library_icon1.png]] is a module within the current model. | * A library [[File:library_icon1.png]] is a module within the current model. | ||
* A filed library [[File:library_icon2.png]] is saved in a separate file, and can be shared among several models.<br /> | * A filed library [[File:library_icon2.png]] is saved in a separate file, and can be shared among several models.<br /> | ||
Line 18: | Line 18: | ||
− | Functions and variables in the top level of the library can be accessed from the | + | Functions and variables in the top level of the library can be accessed from the [[Definition menu]] or [[Object Finder dialog]]. Use modules within the library to hold functions and variables (such as test cases) that are not accessible to models using the library. |
==Adding a filed library to a model== | ==Adding a filed library to a model== | ||
− | Add a filed library to a model using the '''Add Module dialog'''. | + | Add a filed library to a model using the '''Add Module dialog''' in Analytica's [[File menu]]. |
==Using a library== | ==Using a library== | ||
Line 28: | Line 28: | ||
When defining a variable, you can use a function or variable from a library in any of the following ways: | When defining a variable, you can use a function or variable from a library in any of the following ways: | ||
* Type it in. | * Type it in. | ||
− | * Select '''Paste Identifier''' from the | + | * Select '''Paste Identifier''' from the [[Definition menu]] to open the [[Object Finder dialog]]. |
− | * Select '''Other''' from the | + | * Select '''Other''' from the [[The Expression popup menu|expr]] menu to open the [[Object Finder dialog]]. |
− | * Paste from the library under the | + | * Paste from the library under the [[Definition menu]]. |
− | + | :[[File:library_1.png|300px]] | |
===Example=== | ===Example=== | ||
− | Compare the way the [[Capm]]() function is displayed in the | + | Compare the way the [[Capm]]() function is displayed in the [[Object window]] (see Libraries) to the way it is displayed in the [[Object Finder dialog]]. |
− | + | :[[File:library_2.png|400px]] | |
== See Also == | == See Also == | ||
− | * [[ | + | * [[Standard libraries]] |
+ | * [[Additional libraries]] | ||
+ | * [[Modules and Libraries]] | ||
+ | * [[Filed modules and libraries]] | ||
+ | * [[Import a module or library]] | ||
+ | * [[Definition menu]] | ||
+ | * [[The Expression popup menu]] | ||
* [[Change class of an object]] | * [[Change class of an object]] | ||
<footer>Parameter qualifiers / {{PAGENAME}} / Procedural Programming</footer> | <footer>Parameter qualifiers / {{PAGENAME}} / Procedural Programming</footer> |
Latest revision as of 23:29, 9 August 2017
When you place functions and variables in a library, the library becomes available as an extension to the system libraries. Its functions and variables also become available.
There are two types of user libraries:
- A library
is a module within the current model.
- A filed library
is saved in a separate file, and can be shared among several models.
Creating a library
To create a library of functions and/or variables:
- Create a module by dragging the module icon from the node palette onto the diagram, and give it a title.
- Change the class of the module to library or filed library.
- Create functions and/or variables in the new library or create them elsewhere in the model and then move them into the library.
Functions and variables in the top level of the library can be accessed from the Definition menu or Object Finder dialog. Use modules within the library to hold functions and variables (such as test cases) that are not accessible to models using the library.
Adding a filed library to a model
Add a filed library to a model using the Add Module dialog in Analytica's File menu.
Using a library
When defining a variable, you can use a function or variable from a library in any of the following ways:
- Type it in.
- Select Paste Identifier from the Definition menu to open the Object Finder dialog.
- Select Other from the expr menu to open the Object Finder dialog.
- Paste from the library under the Definition menu.
Example
Compare the way the Capm() function is displayed in the Object window (see Libraries) to the way it is displayed in the Object Finder dialog.
See Also
- Standard libraries
- Additional libraries
- Modules and Libraries
- Filed modules and libraries
- Import a module or library
- Definition menu
- The Expression popup menu
- Change class of an object
Enable comment auto-refresher