User Tools

Site Tools


ask_solicit_search_specifications_.htm
Navigation:  ABC Library Reference > ASCIISearchClass > AsciiSearchClass Methods >====== Ask (solicit search specifications) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

Ask( [startline] ), VIRTUAL

blk2blue.jpg

Ask Prompts the end user for search specifications then positions to the specified search value.
startline The offset or position of the line at which to begin the search, typically the current line position. If omitted, startline defaults to one (1).

The Ask method prompts the end user for search specifications then positions the file to the next line subject to the search specifications, or issues an appropriate message if the search value is not found.

Implementation:

The Ask method prompts the end user for search specifications including a value to search for, the direction of the search, and whether the search is case sensitive. If the user invokes the search (doesn't cancel), the Ask method positions the file to the next line containing the search value, or issues an appropriate message if the search value is not found.

Example:

ACCEPT

 CASE FIELD()

 OF ?PrintButton

  IF EVENT() = EVENT:Accepted

   IF ViewerActive THEN Viewer.Printer.Ask.

  END

 OF ?Search                         !on “search” button

  IF EVENT() = EVENT:Accepted

   IF ViewerActive                  !call Searcher.Ask method

    StartSearch=CHOOSE(CHOICE(?AsciiBox)>0, |! passing the currently

    Viewer.TopLine+CHOICE(?AsciiBox)-1,1)    ! selected line as the

    Viewer.Searcher.Ask(StartSearch)         ! search's starting point

   END

  END

 END

END

ask_solicit_search_specifications_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1