.TH lib 3erl "stdlib 1.18.1" "Ericsson AB" "Erlang Module Definition" .SH NAME lib \- A number of useful library functions .SH DESCRIPTION .LP .RS -4 .B Warning: .RE This module is retained for compatibility\&. It may disappear without warning in a future release\&. .SH EXPORTS .LP .nf .B flush_receive() -> ok .br .fi .br .RS .LP Flushes the message buffer of the current process\&. .RE .LP .nf .B error_message(Format, Args) -> ok .br .fi .br .RS .LP Types: .RS 3 Format = \fBio:format()\fR\& .br Args = [term()] .br .RE .RE .RS .LP Prints error message \fIArgs\fR\& in accordance with \fIFormat\fR\&\&. Similar to \fIio:format/2\fR\&, see \fBio(3erl)\fR\&\&. .RE .LP .nf .B progname() -> atom() .br .fi .br .RS .LP Returns the name of the script that started the current Erlang session\&. .RE .LP .nf .B nonl(String1) -> String2 .br .fi .br .RS .LP Types: .RS 3 String1 = String2 = string() .br .RE .RE .RS .LP Removes the last newline character, if any, in \fIString1\fR\&\&. .RE .LP .nf .B send(To, Msg) -> Msg .br .fi .br .RS .LP Types: .RS 3 To = pid() | atom() | {atom(), node()} .br Msg = term() .br .RE .RE .RS .LP This function to makes it possible to send a message using the \fIapply/3\fR\& BIF\&. .RE .LP .nf .B sendw(To, Msg) -> Msg .br .fi .br .RS .LP Types: .RS 3 To = pid() | atom() | {atom(), node()} .br Msg = term() .br .RE .RE .RS .LP As \fIsend/2\fR\&, but waits for an answer\&. It is implemented as follows: .LP .nf sendw(To, Msg) -> To ! {self(),Msg}, receive Reply -> Reply end. .fi .LP The message returned is not necessarily a reply to the message sent\&. .RE