Programming Guide |
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
.
- · A pointer to the text of
msg_id
's message.
- · A string that contains the message class and number if no message exists for
msg_id
.
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 likesm_msg_get
.
#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));
sm_msgfind, sm_msg_read, sm_msg_set