exec_local()

 

The exec_local() function is used to run a local application, such as notepad on Windows. It takes 2 arguments and has the following syntax:

 

exec_local(command, user_id)

 

where:

 

·         command = a variable of the VARCHAR data type or a quoted character string, specifying the path to an application to be launched,

·         user_id = a variable of the VARCHAR data type or a quoted character string, specifying the user account to run an application for.

 

MAIN

  OPEN WINDOW mywin WITH FORM "exec_local_function"

  MENU

    COMMAND "notepad"

     CALL exec_local("notepad.exe", "user")

     

    COMMAND "EXIT"

      EXIT MENU

  END MENU

END MAIN

 

Example form code: exec_local_function.fm2

 

<?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>