• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
        • Compress Function
        • Decompress Function
        • diagnostics Function
        • Encode Function
        • ErrMsg Function
        • ExecSystem Function (Desktop)
        • ExecSystem Function (Mobile)
        • ExecPFF Function
        • GetProperty Function
        • GetLabel Function
        • GetLanguage Function
        • GetSymbol Function
        • GetValueLabel Function
        • hash Function
        • htmldialog Function
        • InValueSet Function
        • Invoke Function
        • IsChecked Function
        • loadsetting Function
        • LogText Function
        • MaxValue Function
        • MinValue Function
        • paradata Function
        • PathConcat Function
        • PathName Function
        • savesetting Function
        • SetLanguage Function
        • SetProperty Function
        • SetValueSet Function
        • SetValueSets Function
        • Special Function
        • sqlquery Function
        • Stop Function
        • SysParm Function
        • tr Function
        • Trace Function
        • UUID Function
        • View Function
        • Warning Function
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

ExecSystem Function (Desktop)

Format
b = execsystem(actionʃ, flagsʅ);
Description
The execsystem function, on a desktop, starts another Windows application or process. There is a related version for applications running on mobile devices.
The string expression action is the name of the application or process to be started. Command line parameters may be included in this expression. If folder or file names contain blanks, then quotation marks (") must surround the names.
An optional set of three flags controls the way that the application is opened, and includes the following options:
CategoryFlagDescription
Program ControlnowaitThe application is opened alongside CSPro. This is the default option.
waitThe application is opened and CSPro waits until it closes to resume program control.
stopCSPro immediately closes and then opens the application. This is similar to what would occur if using the stop function with an argument of 1.
 
Window SizenormalThe application's window is opened in its normal state. This is the default option.
maximizedThe application's window is opened in its maximized state.
minimizedThe application's window is opened in its minimized state.
 
Window FocusfocusThe application is opened and immediately has focus (is "active"). This is the default option.
nofocusThe application is opened without focus.
A combination of flags can be used, with each set separated by a comma.
Return Value
The function returns a logical value of 1 (true) if the new application is started successfully and 0 (false) otherwise.
Examples
// opens the Windows calculator
execsystem("calc.exe");

// opens documentation in Text Viewer
execsystem(maketext('"%sTextView.exe" "C:\\Survey\\Helps.txt"', pathname(CSPro)), maximized, wait);

// open a website in Internet Explorer
execsystem(maketext('"%sInternet Explorer\\iexplore.exe" "https://www.csprousers.org/forum"', pathname(ProgramFiles32)));
See also: SystemApp Object, ExecSystem Function (Mobile), ExecPFF Function, View Function