Usage(usemsg?, program?)
An optional message name. The default is __USAGE.
An optional program name. The default is the current program.
This function prints a QNX 4 use message while a program is running. The default message name is __USAGE, and the default program is the program that is currently running. Generally the defaults are used.
The usage message must be entered in the exact same format as a QNX 4 use message, where each line starts with #. The line immediately before the first QNX 4 use message line (#ifdef...) must be the name of the message, followed by "(double quote). The #endif line at the end of the QNX 4 use message must end with another " (double quote), followed by ; (semicolon). See the example below. For an entry of %C at the beginning of any line, QNX will insert the name of the program.
To use this method, you must load the Usage.lsp library with a call to require_lisp("Usage.lsp").
This example, ex_Usage.g, is included in the product distribution.
#!/usr/cogent/bin/phgamma
/*
The following example puts up a window with an exit button, and prints
a usage message.
*/
PtInit(nil);
require_lisp("Usage.lsp");
require_lisp("PhotonWidgets.lsp");
win = new(PtWindow);
win.SetDim(200,130);
win.fill_color = PgRGB(140,200,250);
but = new(PtButton);
but.SetPos(80,50);
but.text_string = "Exit";
PtAttachCallback(but,Pt_CB_ACTIVATE,#exit_program(3));
__USAGE="
#ifdef __USAGE
#The usage message appears here.
#For example:
#%C
#Push the exit button to exit.
#endif";
Usage();
PtRealizeWidget(win);
PtMainLoop();
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.