|
Command-line Arguments |
Top Previous Next |
|
The server allows you to specify a command line to be passed to the application it invokes, for use as program arguments. These arguments are passed to every task that has been linked against the full Diamond library; stand-alone tasks are not passed arguments.
By clicking View, then Options, and then selecting the General tab, you bring up a window that allows you to give your command line arguments. The arguments are remembered by the server and are used each time you run the server until you change them.
The command line is broken into program arguments, and these are made available to the tasks in an application in the usual C way. When the C main function is called, it is passed the following parameters (as well as others):
int main(int argc, char *argv[])
In fact, the main function has more parameters than these. The others are used for inter-task communications and are discussed in Inter-Task Communication.
Consider executing the command 3L X myprog having previously set the following:
The server starts the application myprog.app and passes in the following values
|