Scripting Language

<< Click to Display Table of Contents >>

Navigation:  Concepts >

Scripting Language

InSights Into Data uses the CS Script scripting language.  This is basically Microsoft's C# programming language.  

 

Why?   So - why did we choose to use C# as our scripting language?  C# allows unlimited power to those creating their own scripts.  We looked at using some standard scripting languages - but they did not have the power or flexibility that we wanted in InSights Into Data!  InSights Into Data is written in C# - and thus we have in house expertise on writing these scripts.  You can basically do almost anything in our scripts that you can do in a regular C# program.  We pass in the main Result Dataset (this is the collection of current InMemory DataTables.  We also pass in the current Table Name, and a reference to the InSights Into Data main form.   This should allow you to modify any in memory table that you want in almost anyway.

 

It should also be noted that C# is Microsofts most popular programming language - so it should be fairly easy to find resources to create your scripts for you - if you do not have the skills inside your own organization.  But with the provided examples we provide - almost any programmer will be able to create scripts fairly easily!!

 

 

 

Sample Script Code.  

This sample code below - shows a template script - with no code in it.  All scripts have this basic format - note the Bold text is where you enter the code you want to run.  To see some examples use the Script Scratch Pad to view those examples.  

 

 

using System;

using System.Data;

using System.IO;

using System.Windows.Forms;

using System.Collections.Generic;

using CSScript_Types;

using InSight;

using System.Collections.Generic;

using System.Linq;

 

public CSScriptReturnValueClass AfterTableProcess(DataSet CurrDataSet, string CurrTableName, Form_InSightsMain MainForm)

{

   CSScriptReturnValueClass ReturnRec = new CSScriptReturnValueClass();

   try

   {                                        

       // Here is the code to be run after the Table is created in the dataset

        //---------------------------------------------------------------------------

 

    // This is where you enter the code you want to have run.  Everything else stays the same!        

 

        //---------------------------------------------------------------------------

 

       // Now Setup the Return Value

       ReturnRec.Success = true;

       ReturnRec.ReturnValue = "";

       ReturnRec.ErrorMsg = "";

   }

   catch (Exception Ex)

   {

       // Now Setup the Return Value

       ReturnRec.Success = false;

       ReturnRec.ReturnValue = "";

       ReturnRec.ErrorMsg = Ex.Message;

   }

   return ReturnRec;

}