Home Image-Pro Automation (Macros, Apps, Reports)

Passing a value to a Sub or Function in an App

Hello,

Just calling an App function/sub that requires no arguments from another module seems straight forward. eg.
        With Automate.ScriptingCommands.PlayMacro(Circles)
            .MacroFile = "Circles>CirclesApp.vb"
            .MacroName = "SetControls"
            .Run(Nothing)
        End With
However, how to or is it possible to call a function/sub in an App that requires a value?  I'm inst rested specifically in the LoadFromFile sub from Circle App.
Is there a better way to interact with the Circle App from another project?

Thanks
    Public Sub LoadFromFile(ByVal FileName As String)
        Dim MySettings As MediaCy.IQL.Application.McSettings = New MediaCy.IQL.Application.McSettings(ThisApplication)
        MySettings.Load(FileName)
        Load(MySettings)
    End Sub

Answers

  • Michael,

    The recorded macro don't have input parameters, but you can create your own subs, like LoadFromFile  in your post, and pass parameters. You can also create global variables and use them inside the subs in that module.

    Regarding Circles app: it's a self-contained app and is not supposed to be called from other projects. You can copy code to your own project, extend it with other subs and functions and do what you need.

    Yuri

Sign In or Register to comment.