BAP Online Manuals : Library Reference : Library by Name : readchar
Previous: read
Next: readdevice

6.2.102. readchar

reads a character from the current input stream

SYNOPSIS

INCLUDE 'iolib.h'
readchar(Char)

SYNTAX

readchar(Char) (o)

ARGUMENTS

char(Char) (o) character that was read

DESCRIPTION

Reads on character form the current input stream and matches it with Char.

EXAMPLE

write("Yes or No ? "),
repeat,
	readchar(Char),
	(	
		member(Char,[`y,`Y]), Answer = yes ;
		member(Char,[`n,`N]), Answer = no 
	),
write(Answer),nl.

ERRORS

No runtime errors.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

get , readln , readdevice


BAP Online Manuals : Library Reference : Library by Name : readchar
Previous: read
Next: readdevice