Expression Library

Description

The Expression Library stores expressions that can be inserted into your script with only a couple of keystrokes.

Multiple Libraries

Alpha Anywhere has an expression library for:

  • Each Table or Set,

  • Each Workspace (.adb file),

  • A Global library

This multi library model replaced a single library model that used a table called a_code_archive.dbf. Multiple libraries were implemented because the expressions that are defined for use in one table are often irrelevant when working with a different table; mainly because different tables use different field names. Because there are still certain expressions that are relevant regardless of what the current table/set is, Alpha Anywhere also provides Workspace and Global libraries as well. The Global Library can be accessed from any Alpha Anywhere workspace on your system. Current Workspace libraries can be accessed from any location in an open workspace. Current Table/Set libraries can only be accessed in the current Table or Set and are stored in text files with a .expn_lib_tbl extension. These files are stored in the same folder as the corresponding table or set. Workspace Libraries are stored in text files with the .expn_lib_db extension. To find the Expression Library first make your way to the Expression Builder.

 Adding an Entry

  1. Create an Expression in the Expression Builder. If you don't enter any expression Alpha Anywhere will display an error message when you try to click add expression. An Expression:

  2. Click the Add expression to Library button at the bottom right of the Expression Builder.

  3. If you have entered an expression, but no part of the expression is currently highlighted, Alpha Anywhere will display this sub-menu after you click the button:

  4. If you have entered an expression, and you have highlighted a portion of an expression, Alpha Anywhere will display this sub-menu after you click the button:

    The second menu choice shows the portion of the expression that is currently highlighted.
  5. After selecting the appropriate option, Alpha Anywhere will ask you to describe the expression and select where you want to store it.

  6. After clicking OK, Alpha Anywhere will display your expression in the Expression Library:

  7. If you are happy with the entry, simply click the Cancel button to save the entry and close the dialog.

    The top window of the Expression Library dialog shows the description of each item in the Library. The bottom window shows the actual expression.

 Editing a Library Expression:

  1. If you want to make any changes to an entry, open the Expression Library and edit the entry in the Expression: window.

  2. Click the Save Changes button. This button only becomes active after you have altered an expression

 Deleting or Editing and Entry:

  1. In the top window of the Expression Library dialog right click on the entry you want to edit or delete.

  2. From the menu that open choose Delete Entry to delete the expression entry or Rename to rename it.

 Sort the Expressions in a Library:

  1. Click on any Expression in the top window of the Expression Library.

  2. Right Click to open the library's menu. Click on Sort to open the sort menu.

  3. Select Ascending to sort your library from A to Z. Ascending Order:

  4. Select Descending to sort your library from Z to A. Descending Order:

  5. Select Unsorted if you want to list the expression entries in the order they were created.

You can also add entries to the Expression Library from within the Library itself. This feature is useful in cases where you want to duplicate an expression and add it to the library under a different entry name. You can also use this feature to create a blank entry and then fill in the entry's full expression at a later point in time. To add an entry from the library, right-click on any entry in the top window of the Expression Library. From the menu that opens select Add New Entry.

The Add Entry to Expression Library Dialog will open. Give your entry a new name and also chose which library you wish to place the entry in.

Click OK to add the new entry to your library. With the new entry open go to the lower window in the Expression library and enter a new expression for the entry. Alternatively you might want to copy another entry's expression. Go to the entry you want to copy, highlight the expression in that entry, and click Ctrl + C to copy. Next go back to the new entry you created and hit Ctrl + V to paste the copied expression into the new entries Expression window.

 Inserting an Entry from the Library into an Expression

  1. From the Expression Builder either double click Library Entry in the menu, or highlight Library Entry and click Insert, or press F9.

  2. The Expression Library will open up. Select the entry that you want to insert and then either click the Insert button, or double click on the entry name.

See Also