BAP Online Manuals : Library Reference : Library by Name : check_equal
Previous: char_int
Next: claim_processes

6.2.18. check_equal

displays error message if arguments don't match

SYNOPSIS

INCLUDE 'prolib.h'
check_equal(Type,Default,["Type has wrong value: 
",Type,"\n"])

SYNTAX

check_equal(Term1,Term2,ErrorList) (x,x,i)

ARGUMENTS

void(Term1) (x) First term to be matched
void(Term2) (x) Second term to be matched
voidlist(ErrorList) (i) List which elements are to be written.

DESCRIPTION

Matches Term1 with Term2. The elements of the ErrorList are written to the console(standard error stream) if this operation fails.

EXAMPLE

Term = 3 +  4,
write(Term," = "),
read(Answer),
Correct is Term,
check_equal(Answer,Correct,["You got it wrong, the correct answer is 
",Correct,"."),nl.

ERRORS

No runtime errors.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

error , write , display


BAP Online Manuals : Library Reference : Library by Name : check_equal
Previous: char_int
Next: claim_processes