skip/[1,2]

Synopsis

skip(+Char)

skip(+Stream, +Char)

Skips over characters from the current input stream, or Stream, through the first character whith an ASCII code that match the lower 8-bits of the value of the integer expression Char.

Arguments


Stream stream_object

Char expr
an integer expression.

Description

Char may be an integer expression. The most useful form of integer expression in this context is the zero-quote notation, for example, 0'a, which evaluates to 97, the ASCII code for the letter a, so that

     | ?- skip(0'a).
     

skips over (ignores) all input until the next occurrence of the letter a.

If Char does appear, skip/1 will consume Char, so that get0/1 will read the following character.

To skip to the end of the current input stream:

     | ?- repeat, get0(-1), !.
     

Exceptions

Stream errors (see ref-iou-sfh-est), plus:


instantiation_error

type_error

domain_error
Char evaluates to a float, or an integer outside the range 0..25.
existence_error
If Char does not appear on the current input stream, an error message is given for reading beyond the end of the stream, and the computation is aborted.

The portion of the input following Char is not a valid Prolog term.

See Also

tab/1