retrieve the character code of the character at the current stream position....
Move to
Next Prev
Up Top
See also
get_char/1/2
get_code/1/2
nl/0/1
peek_char/1/2
peek_code/1/2
put_char/1/2
put_code/1/2
IF Computer > MINERVA > Manual > Reference > Predicates > Character input/output > peek_code/1/2

peek_code/1/2

retrieve the character code of the character at the current stream position.

peek_code(?Char)
peek_code(+Stream, ?Code)

peek_code/1 retrieves the character code of the character at the stream position of the current input stream.

peek_char/2 retrieves the character code of the character at the stream position of the stream Stream.

The stream position will not be altered by these predicates.

peek_code retrieves the character code of the character at the current stream position and unifies it with Code. If the stream position is behind the end of the inputstream, Code will be unified with -1.

Arguments

Stream                 text input stream
Code                   integer (unicode or -1)

Examples

Assume the content of a stream S is abcdefg and the stream position is at the 1st character.

peek_code(0'a). Succeeds. The stream position will not be altered.
peek_char(C). Succeeds with substitution(C<-0'a). The stream position will not be altered.

Standard

These predicates are part of the ISO-Prolog Standard.

See also

get_char/1/2, get_code/1/2, peek_char/1/2, put_char/1/2, put_code/1/2, nl/0/1, set_input/1, current_input/1.

read on...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Language
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/char_io/peek_code/home_en.html
published 2008/10/13 update 2001/8/28 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS