Searching

 

Searching for source files

Searching for 4GL code

Search View

 

LyciaStudio comprises a quick and convenient search engine which allows you to look for files and for the text within the files. The search is performed among the files currently open in LyciaStudio by means of the Search dialog. The results of the search are displayed in the "Search" view which is opened automatically, when the search is complete.

 

Searching for source files

 

To search for source files, do the following:

 

  1. Make sure that "helloworld" project created according to the instructions of this guide is present in LyciaStudio.

  2. Press the SearchDescription: Search icon button on the main toolbar or select the Search -> File main menu option.

 

  1. You will be presented with the search dialog:

 

 

  1. If you know the name of a file you are looking for, type it in the "File name patterns" combo box, e.g "hello.4gl":

a.     If you do not know the exact name of a file, you can enter a part of its name with a wildcard symbol (e.g. hello.*, *.4fm).

b.     If you want to search for a definite type of source files, you can press the Choose… button and select the types of files you want to include into the search criteria:

 

 

c.     Select the *.4gl file type form the list and press OK, you will see it in the "File name patterns" filed:

 

Description: 3.JPG

 

  1. You can search for a file that contains certain text. To do this type the text in the "Containing text" filed. You can make the text case sensitive and if you tick off the "Regular expression" option, Lycia will search only for regular expressions which match the entered text. You can also use the wildcard symbols to substitute a random symbol or a character string. Type the "Hello" string in this field:

 

Description: 12.JPG

 

  1. You can specify the files and folders which should be included into the search in the "Scope" section of the Search dialog. You can search in all files located in the workspace, when the "Workspace" option is selected. Select the "Enclosing projects" option to search only in the selected project. You can select a number of resources (projects, files, etc) in the Project Explorer view or in the 4GL Project view and choose the "Selected resources" option to search only in the selected resources. You can also select a working set as the search target by pressing the Choose… button (for more information about the working sets, see the "Building and compilation" section of this chapter). Leave the Workspace as the scope of search:

 

 

  1. Now the Search dialog should look as follows:

 

 

Lycia will look for all the .4gl files in the workspace that contain "Hello" character string.

 

  1. Press the Search button. The "Search" view will be opened and the search results will be displayed:

 

Description: 13.JPG

 

  1. Double-click on the search result, the file which contains this string will be opened and brought to the top:

 

Description: 14.JPG

 

  1. Press the SearchDescription: Search icon button on the main toolbar again. The Search dialog will be opened with the search criteria used for the previous search.

  2. Press the Replace… button, you will be presented with a Replace dialog which searches for the specified character string and replaces it with the new character string.

  3. Type the character string "Hi" to replace the "Hello" character string:

 

 

  1. Press the Preview> button to preview the result of replacement:

 

 

If the text is found in several source files, select those in which you want to perform changes.

 

  1. Press OK to accept the changes or Cancel to cancel replacement.

 

Searching for 4GL code

 

You can search for the existing source code in other locations. It is a convenient way to find similar source code in different files.

  1. Import any demo project, thus you will have at least two projects in the workspace: your "helloworld" project and the demo project.

  2. Open the hello.4gl file and select the DISPLAY statement with the mouse cursor:

 

Description: 17.JPG

 

  1. Select the Search -> Text ->Workspace main menu option:

 

 

  1. Lycia will search for the DISPLAY statement in all the source files within the workspace and will display the search result in the "Search" view:

 

 

Search View

 

The "Search" view is opened each time a search is complete. It contains the search results. The toolbar of the "Search" view looks as follows:

 

 

The following tools are used to manage search results:

To run the current search one more time, press the F5 button or the Description: 19.JPG button on the search toolbar.

Press the Description: 19.JPG button to view the search history. You will be presented with the list of previously performed searches:

 

 

Here you can view all the searches that have been run and open any of them, either in the same "Search" view or in a new "Search" view which will appear next to the current "Search" view in the same view stack. Opening a search does not run this search again automatically. You can view only the results which were found the previous time this search was run. To update the results of a search opened from the search history, press the  button on the view toolbar to run the opened search again. The search history cannot contain more than 100 search results; the default limit is 10 results.