|
*WindX.utl |
WindX Utility Program |
The WindX utility program, *WindX.utl, provides a variety of functions that simplify the development of applications that make use of WindX.
Format of the CALL:
CALL "[WDX]*WindX.utl;function",params
Use this format to call the utilities/functions in the WindX.utl utility program.
Example:
CALL "[WDX]*WindX.utl;GET_LWD",Station_dir$
CALL "*WindX.utl;SPAWN",cmdline$,inifile$,appfid$
The following functions are built into WindX to simplify development tasks:
|
CALL "[WDX]*WindX.utl;CWDIR",dir$ |
Changes to the specified directory on the WindX client. | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_ADDR",X$ |
Returns the IP address of the WindX client. Note: | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_ARG",X,Y$ |
Returns the command line argument number specified by X in Y$. | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_DIR",X,Y$ |
Returns the DIR( ) information for the directory specified by X (or X$) in Y$. | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_DSK",X,Y$ |
Returns the DSK( ) information for the disk specified by X (or X$) in Y$. | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_FILE_BOX",path$,dir$,title$,ex_list$,def_ex$ CALL "[WDX]*WindX.utl;GET_FILE_BOX_DIRECTORY",path$,dir$,title$,root$ CALL "[WDX]*WindX.utl;GET_FILE_BOX_READ",path$,dir$,title$,ex_list$,def_ex$ CALL "[WDX]*WindX.utl;GET_FILE_BOX_WRITE",path$,dir$,title$,ex_list$,def_ex$ CALL "[WDX]*WindX.utl;GET_FILE_BOX_READ_LIST",path$,dir$,title$,ex_list$,def_ex$ |
Emulates a local call to GET_FILE_BOX directly on the WindX client. The parameters are:
| ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_LPG",X$ |
Returns the LPG (Lead Program Name) system value for the WindX session. | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_LWD",X$ |
Returns the current LWD (Local Working Directory) for the WindX session. | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_NEWPORT",X |
Returns the port number of an unused TCP/IP port on the WindX station. | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_NUM",X$,Y |
Evaluates/returns the value of the numeric expression X$ in Y. Example: Y=EVN(X$) | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_TCB",X |
Returns the value of the TCB function task specified by X in X. Example: | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_VAL",X$,Y$ |
Evaluates/returns the value of the string expression X$ in Y$. Example: | ||||||||||||
|
CALL "[WDX]*WindX.utl;GET_WINDX",X$ |
Returns the absolute pathname of the WindX program. | ||||||||||||
|
CALL "*WindX.utl;SPAWN",X$,I$,F$,HideClient,HideServer |
Spawns a new session of PxPlus on the host and an associated WindX session on the client PC. By default, if the main session terminates, then the spawned session terminates.
| ||||||||||||
|
CALL "*WindX.utl;SPAWN_NOHUP",X$,I$,F$,HideClient,HideServer |
Same as SPAWN but detaches the session from the main user task. If the main task terminates, then the spawned task continues executing. |
Because SSH effectively requires a user to log on to the UNIX/Linux system, spawning a session when you are connected using SSH requires some special settings. This would also be required when using the report viewer *VIEWER* as it spawns a process.
Basically, you have two options, both of which are controlled by setting the global variable %PXPLUS_HOST$ prior calling *WindX.utl;SPAWN.
One option is that you can run *plus/cs/host in the background on your server and set %PXPLUS_HOST$ to your server's IP address, followed by a ; (semi-colon) and the port number (e.g. "192.168.1.123;4093"). This will cause *WindX.utl to connect to the CS host, have it spawn a task, and then connect to it.
The other option is that you can set %PXPLUS_HOST$ to an * (asterisk), followed by the same host address, a ; (semi-colon) and the port number. In this case, you do not need to run *plus/cs//host, as your application itself will spawn the process and connect to it. This will preserve the UserID and other environmental settings in the spawned process.
The challenge is to make sure that the host address you use is the host address as seen by the workstation. For example, if your host server is connected to the Internet using a router, and the workstation will be coming in from outside, then the IP address will need to be the external address and not internal address.