Professional > Data management scripting > Getting started with Data Management scripting > 6. Mastering mrScriptBasic
 
6. Mastering mrScriptBasic
The previous section, 5. Running your first cleaning script, looked at a simple example of using mrScriptBasic to clean the case data. You use mrScriptBasic to write procedural code in the Event sections of your DMS file. There are several possible Event sections, each one being processed at a different time during the execution of the DMS file. Therefore each one is suitable for different types of tasks. For more information, see Event section. However, the Event sections are not compulsory and there are many data management tasks that you can achieve without using an Event section.
mrScriptBasic is based on Visual Basic Scripting Edition (VBScript), which is in turn based on Visual Basic. However, the syntax of mrScriptBasic has some differences from VBScript and Visual Basic. If you plan to write only very simple mrScriptBasic code, you may be able to meet your needs by simply modifying the sample DMS files that are provided with the UNICOM Intelligence Developer Documentation Library. However, if you plan to write more complicated procedures, you will probably find you make faster progress if you spend some time learning mrScriptBasic outside of a DMS file. This section provides some suggestions on how to do that.
1 If you are new to scripting or programing with objects, see Introduction to objects.
2 Read the other introductory sections in mrScriptBasic overview. These give you an introduction to mrScriptBasic, and describe the main syntax differences between mrScriptBasic and VBScript and Visual Basic.
3 Read Creating your first mrScriptBasic script. This section introduces the features in UNICOM Intelligence Professional that help you write mrScriptBasic scripts and explain how to run an mrScriptBasic file in UNICOM Intelligence Professional.
4 Run the mrScriptBasic examples.
5 Read the sections on each of the examples because they draw attention to many things that you need to look out for when you start writing mrScriptBasic code.
6 Read Debugging to learn about the features in UNICOM Intelligence Professional that you can use to help you debug your mrScriptBasic files.
7 Create some mrScriptBasic files of your own and running them. For example, you could try and recreate in mrScriptBasic some of the Visual Basic examples that are in Working with the Metadata Model: Tutorial.
While you are doing this, see mrScriptBasic overview and make full use of the debugging features.
8 Before you start writing mrScriptBasic code in the Event sections of your DMS files, read:
Using objects in the Event sections: Describes which objects are automatically registered with the mrScriptBasic engine in the Event sections.
Event section.
Data cleaning examples: Examples of using mrScriptBasic in the OnNextCase Event section to clean data.
Alternative method for running mrScriptBasic files
The UNICOM Intelligence Data Model includes the mrScript Command Line Runner, which provides an alternative way of running mrScriptBasic files. It also provides some debugging features. For more information, see Command line runner: Debug options.
See also
Getting started with Data Management scripting