General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Using xft form functions in external Macros

  • [email protected]

    Using xft form functions in external Macros

    Participants 0
    Replies 1
    Last Activity 8 years, 5 months ago

    Hi all,

    Say I have my .NET project with XMetal Macros ( On_Document_Save.js , On_Enter.js and etc) and some XFT forms I'm using. In one of the forms inside the Declarations Event I defined a function MyFunction();

    How can I call this function from the XMetal Macros?

    Thanks you,
    AeroSoft Systems Inc.

    Reply

    Derek Read

    Reply to: Using xft form functions in external Macros

    I'm attaching an example that shows how this can be done.

    I've tested it with XMetaL Author Enterprise version 9 but it should work with previous releases (probably back to version 3) and with XMetaL Author Essential. It should also work with XMAX though the macro the launches the XFT would need to be modified in that case so the form could be found.

    Installation:
    1. Download and unzip the file named controlXFTfromMacro.zip
    2. Copy example.xft to the Forms subfolder in your XMetaL Author (Enterprise or Essential) installation.
    3. Copy example.mcr to the Startup subfolder in your XMetaL Author (Enterprise or Essential) installation.

    Running the Example:
    1. Launch XMetaL Author (Enterprise or Essential).
    2. Run the macro named “Example Form – Start”. This will launch the form.
    3. Click the button on the form. This is a standard button and just shows that the XFT is working as it should. It should display an alert box containing the text “Button Clicked”.
    4. Run the macro named “Example Form – Click Hidden Button”. This shows how you can control objects on a form from a macro. It should display an alert box containing the text “Hidden button clicked!”. The macro “clicks” the button on the form and that displays the alert.
    5. Run the macro named “Example Form – Run Internal Function”. This shows how you can pass information from a macro into a form. It should display an alert box containing the text “Passing this string into the XFT function named 'formExposeFn'.” That string is defined in the macro and passed into the form.

    See comments in the MCR file for explanations on the code in each macro.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support