This page describes one of the supplementary ways of running an application.
The main way to run an application is the RUN statement.
winshellexec() and winshellexecwait() are used to open documents on the client PC. These functions are similar to winexec() and winexecwait(). The key difference is that they are executed via a system shell. This can be especially useful on Windows, as it allows an automatic document opening:
CALL winshellexec("c:\\program files\\querix\\hydra\\progs\\myfile.pdf")
Is equivalent to:
CALL winexec("explorer c:\\program files\\querix\\hydra\\progs\\myfile.pdf")
Here is the code snippet illustrating how the functions can be used within the 4GL code:
MAIN
DEFINE file_name VARCHAR(200)
OPEN WINDOW win
AT 1,1
WITH 24 ROWS , 80 Columns
LET file_name = fgl_getenv("QUERIXDIR")
DISPLAY "QUERIXDIR =", file_name AT 5,5
LET file_name = file_name CLIPPED, "/documentation/Multiple_Database_Usage.pdf"
DISPLAY "Multi Database Manual is located in:" AT 6,5
DISPLAY file_name AT 7,5
CALL winshellexec(file_name)
CALL fgl_winmessage("End","WinExec() Demo Application - Press OK to close demo application","info")
END MAIN
If the argument for winshellexec() and winshellexec() does not contain an absolute path to a file, then the file will be searched here: