SEARCH IN STAR4WIN

Searching in text files

Any search process is initiated by pressing F3 and entering the string you want to find.

After finding a string you may continue search by pressing F4.

Search and continue searching backwards by pressing Ctrl F4.

Case sensitivity of the search may be changed in the initial search dialog.

During search you may use wildcards: ? stands for any single letter, @ - for any combination of letters. The wildcard characters may be changed by means of the SETLIKE() function.

Any search will ignore symbols specified in the EXTRACT line of config.str. It is therefore possible to search for sequences ignoring various diacritic signs. The result of such a search, however, will also depend on the current encoding settings. If your configuration uses, e.g., palatino.lst, the diacritics will never be ignored - because they are encoded together with their parent letters as single Unicode characters. If you use the standard configuration (standard.lst) where diacritics are encoded as separate symbols, the search will effectively ignore them - unless, of course, you are searching for a sequence that itself contains diacritics.

Searching in databases

There are three basic ways to search for information in database files.

  1. Search (initiated by F3 and continued by F4; continued backwards by Ctrl F4).

    This way of searching is quite similar to text search. However, after finding the necessary sequence the cursor is positioned not on the found sequence but rather in the beginning of the field where it is contained within the respective database record. If the field is very large you may press Ctrl T and search within this field just as if it were a text file.

  2. Locate (initiated by Ctrl F3 and continued by F4; continued backwards by Ctrl F4).

    This is a more sophisticated procedure, because it searches not just for strings but for results of xBase expressions (see the section on the syntax of xBase expressions). That means that with Locate you may search for almost anything. For example if you want to find a record where the contents of field X are equal to the contents of field Y you may specify X == Y as the Locate expression.

    The most frequent usage of Locate (as experience shows) is finding something in some field. To find the string "x" in the field Y, specify "x" $ y as the Locate expression.

    The dollar sign (the xBase substring operator) is crucial here. Locate is an exact search and is not affected by the case sensitivity settings. To locate ignoring case you must use the Lower(), RLOWER(), Upper() and RUPPER() functions. So, instead of just "x" $ y you must write "x" $ Lower(y) or "X" $ Upper(y).

    Locate is usually slower than simple search. In Star4Win you may also initiate a faster Locate if you use single rather than double quotes in your expressions (thus, if you write 'x' $ y the locate process should be faster). This search, however, may be less exact if your database file is considerably fragmented, so search with double quotes is preferable.

  3. Seek (initiated by Alt F3).

    This type of search operates only on indexed or sorted database files and is the quickest. However, it only performs search on the indexed or sorted field.

    To use this sort of search you must first index or sort your file. If while indexing you use the StarLing ORDER() function, the file will be arranged according to the alphabetical order specified in the ORDER line of config.str. Otherwise plain ASCII order will be used. To index your file use the ASSIST Index option and specify ORDER(X) as the key expression (X here is the name of the field that is to be rearranged).

    During seek with the ORDERed key expression all diacritics specified in the EXTRACT line of config.str are also ignored.

    Files can be physically sorted using the ORDER() function. However, in sorted files only plain ASCII Seek may be performed.

When two databases are open simultaneously, more sophisticated search routines can be performed:

Search and Replace

Search and Replace is also possible, both in text files and in database files (although in the latter the preferable way is the more sophisticated Reform procedure).