Omnis Technical Note TNGI0006

Omnis Studio Prompt for Search Class

For Omnis Studio 2.0 or later
By Richard Miller

How can I prompt users to select a search class, now that the 'Prompt for Search Class' command and dialog have been removed in Omnis Studio?

You can build your own dialog window and code to prompt users for a search class, or you can
use the library accompanying this tech note. The sample library PromptForSearch.lbs recreates the
Prompt for Search dialog; it contains the following classes:

Code class: cPforSearch
Menu class: mMenu
Window classes: wPromptForSearch & wEditSearch

The library can be used in one of two ways.

1. Use as a standalone library and access it like this:

Do code method PROMPTFORSEARCH.cPforSearch/
Prompt ($clib) Returns lClass

2. Copy the window class to your own library and access it like this:

Do $windows.wPromptForSearch.$openonce('*',
kWindowCenter, $clib, lClass)

In both cases, the variable lClass contains the name of the selected search class or empty if none selected. The dialog displayed is similar to that used in the OMNIS 7 'Prompt for search format' command

When the dialog opens, the current search class is shown in bold if it is available within this library.
The names and description of the searches can be edited by clicking twice within the headed list.
The checkbox 'Include other libraries' lets you show and select any search classes contained in other libraries which have been marked as $external(kTrue).

To set a search class as the current search, either double-click the required search or select it and press Accept. The Rename, Delete and Modify buttons only function when a search class has been selected.