Also used to check that N is a valid error number. N is an integer.
Success: ?- current_error(N). N = 1 More? (;) % type `;' N = 2 More? (;) N = 4 More? (;) N = 5 More? (;) % carriage return typed yes. ?- [user]. list_error1(String, N, Message) :- current_error(N), error_id(N, Message), substring(Message, String, _). user compiled 208 bytes in 0.03 seconds ?- list_error1("def",N,M). N = 21 M = "undefined arithmetic expression" More? (;) yes. Fail: current_error(3). Error: current_error(1.0). (Error 5).