|
Launching PxPlus |
|
|
1. |
Windows 32-Bit: path \pxplus\pxplus.exe [ winprms ][ ini ][ overrides ][ prog ][ pvxprms ][ -ARG list ] |
|
2. |
UNIX: path /pxplus/pxplus [ unixprms ][ overrides ][ prog ][ pvxparms ][ -ARG list ] |
Where:
|
path \pxplus\pxplus.exe |
Specific Windows or UNIX/Linux command to start PxPlus in Command mode. |
|
-ARG list |
The dash and keyword (-ARG) mark the start of a list of optional arguments you can pass to the program on start-up. The list of arguments (arg1 arg2 ...) is space separated. If an argument contains spaces, enclose it in quotation marks. For more information on arguments, see NAR system variable and ARG( ) function. | ||||||||||||
|
-cpl |
When the Command line contains the -cpl tag, the *compiler program will look for the source file provided, convert it to a program file and output any errors on *stderr* or an error file specified on the Command line. The syntax of the -cpl option is: pxplus -cpl [ sourcetext ] programfile [ -pswd password ] [ -err errfile ] Where:
See Command Line Compiler/Lister. Note: | ||||||||||||
|
ini |
Name of an INI file to use (for Windows and UNIX/Linux as of PxPlus v10). Optional. String expression. You can have different start_up commands with different INI files so that each application can be set up with its own defaults for fonts, window size, etc. Default: See INI Files (Windows). | ||||||||||||
|
-lst |
When the Command line contains -lst, the *compiler program is expected to take a program file and list it to either an ASCII text file or stdout. The syntax of the -lst option is: pxplus -lst programfile [ sourcetext ] [ -pswd password ] [ -err errfile ] Where:
See Command Line Compiler/Lister. Note: | ||||||||||||
|
overrides |
Optional arguments that override start_up. Valid overrides are:
| ||||||||||||
|
prog |
Optional name of a program to run at start-up (lead program). C:\pxplus\pxplus.exe -PC=10 | ||||||||||||
|
pvxprms |
Optional PxPlus system parameters to set from the Command line. Most PxPlus system parameters are valid, including:
The dash is mandatory and indicates that the argument is a parameter. Do not use single quotes. However, it is better programming practice to set/reset parameters from within PxPlus applications via the SET_PARAM directive. See System Parameters. | ||||||||||||
|
winprms |
(For Windows Only) Optional window parameters (see Note below):
| ||||||||||||
|
(For UNIX/Linux Only) Optional parameter to set from the Command line.
(The - -version parameter was added in PxPlus 2025 Update 1.) |
The formats above describe the various syntax elements you can include in your Command line to start PxPlus. It is strongly recommended that you always include the full (absolute) path name of the executable file in this command.
To Return Command-Line Values
As noted above, you can use the ARG( ) and FID( ) functions, as well as the HWD, NAR and LPG system variables, to retrieve the values in current use.
Example:
The following example illustrates the basic command in Windows:
C:\my_directory\pxplus\pxplus.exe This command includes a lead program: C:\my_directory\pxplus\pxplus.exe my_program
Other syntax elements appear as follows:
C:\pxplus\pxplus.exe -mn program_1 -dr=h:\acct_pay
C:\pxplus\pxplus.exe myapp.ini my_program -id=t0 -dr=mary -xt=1
C:\my_directory\pvx\pxplus.exe myapp.ini windx
C:\my_directory\pvx\pxplus.exe myapp.ini *nthost
What Happens During PxPlus Start Up?
When a new session of PxPlus starts up, several programs are run to establish the environment and launch your application. The programs that run are explained below:
|
1. |
Internally, PxPlus determines the type of terminal being used to run PxPlus and runs its terminal setup program. These are found in *dev directory. For Windows, this will be *dev/windows. For WindX connections using Simple CS, NTHost or the Application Server, this will be *dev/winterm. For UNIX/Linux, the system will get the terminal type from the environment variable TERM and run *dev/xxxxx where xxxxx is the terminal type in lowercase. If this is not found, the system will run *dev/termcap, which will try to generate the device driver from the system termcap information. Note:
|
|
2. |
Once the terminal is configured, an internal CALL to "*start.up" is executed to do the following: |
|
3. |
Runs the program specified on the Command line if any (the "Lead" program found in the LPG system variable). If no program is specified, the system will drop to the Command line prompt. |
If you want to set your system parameters and prefix(es) or do other initialization logic, you generally will perform this in your start up program in the starting directory for PxPlus. This will be run before your lead program is executed.
The -BKG command line parameter can be used with the Windows pxplus.exe to indicate that the process is a background task and, as such, will not and cannot interact with the desktop/user. Processes that specify this parameter on the Command line will be prevented from accessing the desktop.
As a background, the process will not consume a user slot from the system activation key. This provides the same functionality as specifying >/dev/null </dev/null on the Command line used to launch PxPlus on UNIX/Linux.
(The '-BKG' system parameter was added in PxPlus v9.00, build 9200.)
Background
Normally, using PxPlus on a Windows system, each invocation of the software occupies a user slot regardless of whether the process was merely a background task or was truly going to interact with the end user. Even processes that have no user interaction still require a user slot - in effect resulting in a "phantom user".
This phantom user problem is a Windows-system issue. On UNIX/Linux, PxPlus can detect true background processes by the fact that the user input and output devices were set to /dev/null. With the user input/output disabled, no user interaction would be possible from the process, thus the process was truly a background task. This is why on UNIX/Linux, we always recommend that you append >/dev/null and </dev/null to any command launching a background process such as NTHOST.
Consequently, with this Windows-only problem/limitation, you often had to purchase an extra user slot for this "phantom user" when running on a Windows server as opposed to UNIX/Linux.
Using -BKG
Specifying -BKG on the Command line can be used to address this situation by identifying a process as a background task that will not have any end-user interaction.
Example:
C:\PVX Plus Technologies\PxPlus version_number\pxplus.exe -bkg *plus\cs\host
When a Windows process is initiated with this command line parameter, the process will not occupy a user slot; however, no windows or message boxes will be presented to the user. In effect, the process will, like its UNIX background task counterpart, not have any user input/output capabilities.
However, it will be able to run programs in the background just like a UNIX system and will accept signals from foreground processes to terminate or perform other tasks.
This feature has been incorporated into *NTHOST and the PxPlus Simple Client Server (*plus/cs/host) to eliminate the need for an extra user when running on a Windows host.
The *compiler program will automatically be called whenever the Command line starting PxPlus contains -cpl or -lst. Internally, when either of these parameters is detected in the Command line, the system will run *compiler as the lead program and pass all Command line parameters starting with the -cpl or -lst to the program.
The purpose of this program is to then parse the Command line to extract the name of a program file and either compile a text file from source to create the program or list the program. Errors will display in the error output as filename:lineno:chofst: errmsg.
Examples:
[path]pxplus[.exe] -cpl pgm\pgrm.txt pgm\pgrm.pxp -err tmp\err.txt -pswd password
[path]pxplus[.exe] -cpl pgm\pgrm.txt pgm\pgrm.pxp -err tmp\err.txt
[path]pxplus[.exe] -cpl pgm\pgrm.txt pgm\pgrm.pxp 2>tmp\err.txt
[path]pxplus[.exe] -cpl pgm\pgrm.pxp -err tmp\err.txt 0<pgm\pgrm.txt
[path]pxplus[.exe] -cpl pgm\pgrm.pxp 2>tmp\err.txt 0<pgm\pgrm.txt
[path]pxplus[.exe] -lst pgm\pgrm.pxp pgm\pgrm.txt -err tmp\err.txt
[path]pxplus[.exe] -lst pgm\pgrm.pxp pgm\pgrm.txt
[path]pxplus[.exe] -lst pgm\pgrm.pxp -err tmp\err.txt 1>pgm\pgrm.txt
[path]pxplus[.exe] -lst pgm\pgrm.pxp 1>pgm\pgrm.txt
[path]pxplus[.exe] -lst pgm\pgrm.pxp -pswd password 1>pgm\pgrm.txt
[path]pxplus[.exe] -lst pgm\pgrm.pxp -err tmp\err.txt -pswd password 1>pgm\pgrm.txt