Register to post in forums, or Log in to your existing account
 

 Related 
Contents
Database Module
  Creating a Database
  Database Views
  Adding Data to a Database
  Quick Filters
  Programming the Database
  Advanced Database usage
Related Links:
  Database Module
Quick Filters [[CMUD_Quick_Filters]] 
Quick Filters

In many cases you just want to Find a certain set of records in the database. Instead of providing a Find and a Find Next command, CMUD uses Quick Filters to display a list of matching records. Quick Filters are similar to the filters used to create a View, but can be applied more quickly on top of a current View.

To create a Quick Filter, display the Filter Panel if it is not already displayed by selecting it under the Toolbar menu in the View menu. Once the filter panel is turned on, it will be displayed just below the list of database views. It has controls similar to creating a filter in the View window. On the left is the Field Selection control. Select the field you want to search or filter on. To the right of the field selection is the NOT option box, followed by the Operation selection. The available operations are the same as for the View itself. Once the operation is selected, the appropriate value box will be displayed. Enter the value you want to search for and click the Filter button. Click the Clear button to clear the filter and return to the full view.

For example, to display all of the "swords" in the Weapons view, turn on the filter panel, select Name in the field selection box, select Contains in the operation selection, and enter the word "sword" into the value field and click Filter. All of the records in the current view with a Name that contains the word "sword" will be displayed. You can then treat the data just like a normal view, including editing. However, the quick filter has no effect on creating new records. New records are created just like then would be if you cleared the filter.

Note that CMUD does not reapply the filter until you change it or click the Filter button. In the above example we can then create a new record and enter a name of "ax" into the Name field. The new record will still be displayed even though we are filtering on "sword". However, as soon as you click the Filter button, the new "ax" record will disappear since it doesn't match the filter.

The Quick Filter is a global filter that applies to all views. For example, if you set up a filter to display records whose Level field is greater than or equal to 20 (try it), you can then click on different views, such as Weapons and Armor and in each case you will also see the records with a level >= 20. This is a powerful feature for searching for particular types of equipment in your database.

The Quick Filter also updates the view automatically when the filter parameter is changed. In the above example displaying equipment with a Level >= 20, you can click the Up arrow button next to the value 20 to change it to 21. The view will then instantly change to show equipment with Level >= 21. This is an easy way to browse through your database based on various criterion.

The Quick Filter is not saved with your database file. It is only active while you are actually using the database. If you quit CMUD and reopen the database, the filter panel will still be displayed, but the filter will be cleared. If you want a filter to remain, you are better off adding it to a specific view in the View window and saving the database.
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net