This page describes one of the supplementary ways of running an application.
The main way to run an application is the RUN statement.
winexec() and winexecwait() request the GUI client to execute a command on the operating system the parent application is being run on.
The syntax of the functions are similar to the one of the RUN statement:
CALL winexec(app-name) (= RUN app_name WITHOUT WAITING)
CALL winexecwait(app_name) (= RUN app_name)
All the file names you use in your 4gl development must be platform-independent.
If you use platform-dependent names (e.g., combine upper and lower case, use colons, finish names with a full stop, etc.), please remember that they might cause different problems when you move your project to another platform.
The main difference between RUN and winexec()/winexecwait() is that the child application launched this way is executed on the client side.
MAIN
OPEN WINDOW mywin WITH FORM "exec_local_function"
MENU
COMMAND "notepad"
CALL winexec("notepad.exe") -- or CALL winexecwait("notepad.exe")
COMMAND "EXIT"
EXIT MENU
END MENU
END MAIN
example form code
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://namespaces.querix.com/2011/fglForms" title="New Form 1">
<gridpanel identifier="rootContainer" fieldType="FORM_ONLY" fieldTable="formonly" enable="true" visible="true">
<preferredsize width="200"/>
<items>
</items>
<gridrowdefinitions>
<gridrowdefinition>
<gridlength gridLengthType="AUTO"/>
</gridrowdefinition>
</gridrowdefinitions>
<gridcolumndefinitions>
<gridcolumndefinition>
<gridlength gridLengthType="Percent" gridLengthValue="100.0"/>
</gridcolumndefinition>
</gridcolumndefinitions>
</gridpanel>
<screenrecords>
<screenrecord identifier="FormOnly"/>
</screenrecords>
</form>