Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3320850
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:59:33+00:00 2026-05-17T22:59:33+00:00

Below is my code, which opens up a Monarch instance, and does some actions

  • 0

Below is my code, which opens up a Monarch instance, and does some actions with Monarch (Monarch is a datamining tool)

I have to repeat the below code, simply changing a few parameters each time, is there a way to programatically do this? I want to know the most effeicent way of doing this.

a = MonarchObj.SetReportFile(rawdataS10, False)
openModel = MonarchObj.SetModelFile(freeKidsModel)
            MonarchObj.CurrentFilter = "Under 60"


    SummerDateShow = MonarchObj.SetFieldVisible("Date2", False)
    SummerDateHide = MonarchObj.SetFieldVisible("Date", True)

ExportTOS = MonarchObj.JetExportTable(saveDir, "FreeKidsS10", 0)
MonarchObj.CloseAllDocuments

An example of the parts i’m changing are “Under 60” “FreeKidsS10” and the Date & Date2 fields.

If simply copy and pasting this code is the most effecient code, you can tell me to go away

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:59:34+00:00Added an answer on May 17, 2026 at 10:59 pm

    You could make a procedure that takes as parameters the variable fields and then call that procedure wherever you would otherwise copy and paste. The signature of that method would be something like this:

        Public Sub DataMiningMethod(ByVal modelFile as object, _
                                    ByVal currentFilter as String, _ 
                                    ByVal date1 as Boolean, _
                                    ByVal date2 as Boolean, _
                                    ByVal exportTableName as String)
    

    Thus the entire method would look something like this:

    Public Sub DataMiningMethod(ByVal modelFile as object, _
                                ByVal currentFilter as String, _ 
                                ByVal date1 as Boolean, _
                                ByVal date2 as Boolean, _
                                ByVal exportTableName as String)
    
        a = MonarchObj.SetReportFile(rawdataS10, False)
        openModel = MonarchObj.SetModelFile(modelFile )
                MonarchObj.CurrentFilter = currentFilter 
    
    
        SummerDateShow = MonarchObj.SetFieldVisible("Date2", date2 )
        SummerDateHide = MonarchObj.SetFieldVisible("Date", date1 )
    
        ExportTOS = MonarchObj.JetExportTable(saveDir, exportTableName , 0)
        MonarchObj.CloseAllDocuments
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to pull some information from my tnsnames file using regex. I
I'm trying to build a C++ extension for python using swig. I've followed the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.