wcMessagePage( )

Syntax . . Returns . . Tips . . Program Example . . Related Topics . . A-Z Index . . Home

Displays an HTML page in the browser.

Example

returnCode = wcMessagePage(cntrlHandle, "Result", "Result: %s", val);

Syntax

int wcMessagePage(void *controlHandle,
                  char *title,
                  char *format, 
                  valueToPrint[, valueToPrint]...)
controlHandleThe handle to the control structure.
titleValue to appear in the <TITLE> tag of the output HTML page.
formatA formatting string that specifies how to convert and print the output. Syntax is identical with that used in the C printf( ) function.
valueToPrintThe value to be printed in the message, typically a variable.

Returns

0Success.
Error codeFailure or exception. For a list of possible error codes, see Error Messages.

Tips

Program Example

The following code shows how wcMessagePage( ) is used in an application.

int main(argc, argv)
	int	argc;
	char	**argv;
{
	void	*wcp;
	int	ret;
	char	*MiVal;
	...
	
	if((ret = wcInit(argc, argv, &wcp)) < 0)
		return wcTraceErr(wcp, ret);
	...

	while(1)
	{
		if((ret = wcConOpen(wcp, 0)) < 0)
			return wcTraceErr(wcp, ret);
		wcGetVariable(wcp, "MiVal");

	/* Perform some calculation on MiVal */
	...

	wcMessagePage(wcp, "Result", 
		"The value of MiVal is <B>%s</B>", MiVal);
	...

	if((ret = wcConClose(wcp)) < 0)
		return wcTraceErr(wcp, ret);
	}

	return wcExit(wcp);
}

Related Topics

wcLogPrintf( )
wcPrintf( )


Top of Page . . Syntax . . Returns . . Tips . . Program Example . . A-Z Index . . Home