Programming Guide



sm_msg_set

Replaces a message

#include <smerror.h>
int sm_msg_set(int msg_id, char *text);

msg_id
Specifies the message to set using its number, as defined in smerror.h.

text
The replacement message.

Returns

Description

sm_msg_set a replaces a message file entry. When a message is replaced, there is no way to restore the original message other than copying its text and then calling sm_msg_set again. This function first appeared in Panther 4.60.

Example

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

// To replace SM_5DEF_DTIME with 2 digit time tokens use:

sm_msg_set(SM_5DEF_DTIME, "%0m/%0d/%2y %0h:%0M");

// To restore SM_5DEF_DTIME to its value in the default msgfile:

sm_msg_set(SM_5DEF_DTIME, "%m/%d/%2y %h:%0M");

See Also

sm_msg_get