QT Class RadProcess

 

Overview

The RadProcess class allows the execution and control of other host processes. For instance, the current process could launch Excel in another process or launch a multi-process machine learning application.

new

Overview

The new function creates a new RadProcess object and returns a pointer to the newly created object. The RadProcess is one of the class key words accepted by the qt new: function. There can be many RadProcess objects.

 

Syntax

(qt new: RadProcess:)

Arguments

ReturnsAlways returns a pointer to the newly created RadProcess object.

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process startDetached: processArgs)                ;; Launch Excel in a separate process and return allowing Excel to run on its own.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

delete

Overview

The delete function destroys a RadProcess object and returns a null pointer.

 

Syntax

(qt delete: RadProcessPtr)

Arguments

radRadProcessPtrThe pointer to the RadProcess object to be destroyed.
ReturnsAlways returns a null pointer.

 

Example1

(setq radProcessPtr (qt new: RadProcess:)) ;; Create a RadProcess object.
(setq radProcessPtr (qt delete: radProcessPtr)) ;; Destroy the RadProcess object.

error

Overview

The RadProcess error function gets the last Integer error code for the specified process.

 

Syntax

(setq errCode (qt radProcessPtr error:))

Arguments

errCode Always returns the Integer error code of the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process execute: processArgs)                      ;; Launch Excel in a separate process and wait until Excel finishes.
        (setq errCode (qt process error:))                     ;; Get the error code from Excel (0 is no error).
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

errorString

Overview

The RadProcess errorString function gets the last error String for the specified process.

 

Syntax

(setq errString (qt radProcessPtr errorString:))

Arguments

errString Always returns the error String of the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process execute: processArgs)                      ;; Launch Excel in a separate process and wait until Excel finishes.
        (setq err (qt process errorString:))                   ;; Get the error String from Excel ("" is no error).
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

execute

Overview

The RadProcess execute function executes the specified process synchronously and waits for the process to complete before returning control.

 

Syntax

(setq exitCode (qt radProcessPtr execute: programArguments))

Arguments

programArguments The program command line arguments necessary to launch the process.
result Always returns #void

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process execute: processArgs)                      ;; Launch Excel in a separate process and wait until Excel finishes.
        (setq errCode (qt process exitCode:))                  ;; Get the exit code from Excel (0 is no error).
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

exitCode

Overview

The RadProcess exitCode function gets the Integer exit code for the specified process.

 

Syntax

(setq exitCode (qt radProcessPtr exitCode:))

Arguments

exitCode Always returns the Integer exit code of the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process execute: processArgs)                      ;; Launch Excel in a separate process and wait until Excel finishes.
        (setq errCode (qt process exitCode:))                  ;; Get the exit code from Excel (0 is no error).
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

exitStatus

Overview

The RadProcess exitStatus function gets the Integer exit status for the specified process.

 

Syntax

(setq exitStatus (qt radProcessPtr exitStatus:))

Arguments

exitStatus Always returns the Integer exit status of the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process execute: processArgs)                      ;; Launch Excel in a separate process and wait until Excel finishes.
        (setq errCode (qt process exitStatus:))                ;; Get the exit code from Excel.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

kill

Overview

The RadProcess kill function kills the the specified process immediately.

 

Syntax

(retCode (qt radProcessPtr kill:))

Arguments

retCode Always returns the Integer code after killing the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process execute: processArgs)                      ;; Launch Excel in a separate process and wait until Excel finishes.
        (setq retCode (qt process kill:))                      ;; Shut down Excel immediately.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

pid

Overview

The RadProcess pid function gets the Integer host process ID for the specified process.

 

Syntax

(setq pid (qt radProcessPtr pid:))

Arguments

pid Always returns the Integer process ID of the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process execute: processArgs)                      ;; Launch Excel in a separate process and wait until Excel finishes.
        (setq pid (qt process pid:))                           ;; Get the process ID for this Excel invocation.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

setWorkingDirectory

Overview

The RadProcess setWorkingDirectory function sets the working directory for the specified process.

 

Syntax

(qt radProcessPtr setWorkingDirectory: workingDirectory))

Arguments

workingDirectory The program working directory necessary to launch the process.
result Always returns #void

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process setWorkingDirectory: _excelPath:))         ;; Set the RadProcess working directory
        (qt process execute: processArgs)                      ;; Launch Excel in a separate process and wait until Excel finishes.
        (setq errCode (qt process exitCode:))                  ;; Get the exit code from Excel (0 is no error).
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

start

Overview

The RadProcess start function executes the specified process asynchronously and returns control immediately. The start method does NOT wait for the process to complete before returning control.

 

Syntax

(qt radProcessPtr start: programArguments))

Arguments

programArguments The program command line arguments necessary to launch the process.
result Always returns #void

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process start: processArgs)                        ;; Launch Excel in a separate process and do NOT wait for Excel to finish.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

startDetached

Overview

The RadProcess startDetached function executes the specified process asynchronously and returns control immediately. The start method does NOT wait for the process to complete before returning control.

 

Syntax

(qt radProcessPtr startDetached: programArguments))

Arguments

programArguments The program command line arguments necessary to launch the process.
result Always returns #void

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process startDetached: processArgs)                ;; Launch Excel in a separate process and do NOT wait for Excel to finish.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

state

Overview

The RadProcess state function gets the Integer state for the specified process.

 

Syntax

(setq state (qt radProcessPtr state:))

Arguments

state Always returns the Integer state of the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process start: processArgs)                        ;; Launch Excel in a separate process and do NOT wait for Excel to finish.
        (setq state (qt process state:))                       ;; Get the process state for this Excel invocation.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

terminate

Overview

The RadProcess terminate function kills the the specified process but gives time for the process to terminate in an orderly fashion.

 

Syntax

(retCode (qt radProcessPtr terminate:))

Arguments

retCode Always returns the Integer code after terminating the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process start: processArgs)                        ;; Launch Excel in a separate process and do NOT wait for Excel to finish.
        (setq retCode (qt process terminate:))                 ;; Shut down Excel but give time for Excel to terminate in an orderly fashion.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.
        

workingDirectory

Overview

The RadProcess workingDirectory function gets the workingDirectory String for the specified process.

 

Syntax

(setq dirString (qt radProcessPtr workingDirectory:))

Arguments

dirString Always returns the workingDirectory String of the process

 

Example1

        (setq processArgs (append _excelPath " mytable.csv"))  ;; Set up the Excel command line with the delimited table to be viewed.
        (setq process (qt new: RadProcess:))                   ;; Create a new RadProcess object
        (qt process start: processArgs)                        ;; Launch Excel in a separate process and do NOT wait for Excel to finish.  
        (setq dirString (qt process workingDirectory:))        ;; Get the workingDirectory String for Excel.
        (setq process (qt delete: process))                    ;; Delete the RadProcess object.