[Prev] [Next] [Top] [Bottom] [Contents] (15 out of 193)

SaCatGets

Returns a message from the Sapphire/Web message catalog.

Synopsis

#include "SaPopCalls.h"

char* SaCatGets(int set_num, int msg_num, char* default_str);

Arguments

set_num
The message set number.
msg_num
The message number.
default_str
The default string to return if no message is found.

Return Values

If SaCatGets is successful, it returns a pointer to a buffer containing the message text. The buffer is statically allocated and is reused the next time UxCatGets is called. If SaCatGets cannot retrieve the message text from the message catalog, it returns default_str.

Description

SaCatGets attempts to read the message msg_num from the set_num in the open message catalog. This function looks for a file dbuimx2_6.cat in the directories specified by the environment variable, NLSPATH. The source file for the dbuimx2_6.cat file is dbuimx2_6.msg. This file contains the text for the Sapphire/Web message catalog. Set one is reserved for Sapphire/Web and should not be used. It contains various strings used in the client screens, such as the Login and the SaConsole.

Note: Be careful, the string returned points to a statically allocated buffer that is reused the next time SaCatGets is called. For example, if you call a function that takes 2 char* parameters and use the return of SaCatGets as expressions for those to parameters, one will actually be the copy of the other. When in doubt, copy the return value of SaCatGets.

Example

printf("%/%", SaCatGets(1,1,"/tmp"),
	SaCatGets(1,2,"file.dat"));

Result

file.dat/file.dat


[Prev] [Next] [Top] [Bottom] [Contents] (15 out of 193)