Command: search

Syntax

search <channel> ,<string>

Description

Search the data on a system input channel for the occurrence of a string.

Parameters

Switches

Notes

The search command may only be used on channels opened for reading, i.e. modes r and rw.

An empty <string> will result in no action.

If the search is successful, <channel> will be positioned so that the next read or search command will start at the line where the match was found. The system numeric found will then be set to 1.

If the search is unsuccessful, <channel> will be positioned at where it was before the command was executed. The system numeric found will then be set to 0.

Example

Open a file for reading, and search for "close".

open chan1, -f=test.dat
search chan1,'close'
if (found) !Got it; else !Not there
chan1.close

See Also

Commands:

close, open, read

Identifiers:

chan# (channel), found (numeric)

Structures:

channel, channel.rewind