Programming Guide



sm_msg_get

Finds a message

#include <smerror.h>
char *sm_msg_get(int msg_id);

msg_id
Specifies the message to get through its number or name, defined in smerror.h.

Returns

Description

sm_msg_get gets a message from a message file previously loaded by sm_msg_read. Message files are binary files, created through the Panther utility msg2bin, whose contents are accessible through Panther library functions like sm_msg_get.

Example

#include <smdefs.h>
#include <smerror.h>

/* Assume that an anxious programmer has just
* typed in the question, "Will my boss like
* my new program?" This code fragment answers
* the question.
*/

sm_n_putfield("answer", rand() & 1 ?
sm_msg_get(SM_YES):
sm_msg_get(SM_NO));

See Also

sm_msgfind, sm_msg_read