Programming Guide |
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.
- · 0 on success.
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 callingsm_msg_set
again. This function first appeared in Panther 4.60.
#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");