Top
PowerCOBOL V11.0 Reference
FUJITSU Software

5.43 ExecuteSync Method

Description:

Executes an application synchronously.

Control is not returned to the invoking program until the executed application terminates. (Note that the form remains active, it is just the invoking code that waits for the application to terminate.)

Used in controls:

None.

Used in objects:

Form

Parameters:

1. VT_BSTR - CommandLineX(8192)
2. [VT_I4 - ShowWindowS9(9) COMP-5]

3. [VT_I4 - ReturnValueS9(9) COMP-5]

Description of Parameters:

CommandLine: The command line for the application to be executed.
Includes the application name, command line parameters and, if necessary, the full path name if that is different from the current directory and the path is not set in the PATH environment variable.

ShowWindow: The manner in which the application should be invoked.
This parameter can be omitted in calling from the Form object. If it is omitted PowerCOBOL uses POW-SWSHOWNORMAL as default.
Use the following constants to set the value of ShowWindow:
POW-SWHIDE: Starts the application in the background - it does not display a window.
POW-SWSHOWNORMAL: (Default) Activates the application using its default window size.
POW-SWNORMAL: Same as POW-SWSHOWNORMAL.
POW-SWSHOWMINIMIZED: Activates the application in the minimized state.
POW-SWSHOWMINNOACTIVE: Starts the application in the minimized state but leaves an active window unchanged.
POW-SWSHOWMAXIMIZED: Activates the application with the window maximized.

ReturnValue: The value that is returned from the command.
If the command does not return any value, the ReturnValue is not set.

Return value:

None.

Example:

Shows how to start the Windows Notepad with the autoexec.bat file loaded.

 WORKING-STORAGE SECTION.
 01 Command-Line	PIC X(128).
 PROCEDURE       DIVISION.
     MOVE "Notepad c:\autoexec.bat"
       TO Command-Line
     INVOKE MainForm "ExecuteSync"
       USING     Command-Line 
                 POW-SWSHOWNORMAL 

Backward compatibility
method name:

None.