Leaders in Innovative Research Solutions

MRDCL's shorthand language

MRDCL's shorthand language

Use of the easy to learn scripting language of MRDCL can be taken to a higher level by making use of a shorthand language that exists within MRDCL known as the pre-processor.

The pre-processor allows users to specify repetitive MRDCL code in a shorter way. For example, let’s say that you want 20 variables for 20 rating statements, you could enter the first definition and copy and paste the next 19 making appropriate changes. However, it is easy to make errors doing this, so MRDCL has a pre-processor language that allows you to specify this in a shorthand way, so that generates 20 variable definitions by ‘looping’ through your code 20 times. This makes amendment easier and reduces errors that may be hard to find.

It works by expanding the code you have written in the pre-processor, i.e. before it processes your instructions, as though you had written it in the full longer way.

The pre-processor allows you to store lists, set values and has a number of techniques to look up values for you. Here’s a simple example:

[*data animals=lions, tigers, elephants, whales, dolphins]

[*do a=1:5]

ds $q1_[a]=$[a+100]/1-3,

x=’Like;

Neither like nor dislike;

Dislike’,

xt=’Q1 – [a]. Whether like [animals.a]’,

[*end a]

This would generate 5 variables for you, which would like this…..

ds $q1_1=$101/1-3,

x=’Like;

Neither like nor dislike;

Dislike’,

xt=’Q1 – 1. Whether like lions’,

ds $q1_2=$102/1-3,

x=’Like;

Neither like nor dislike;

Dislike’,

xt=’Q1 – 2. Whether like tigers’,

ds $q1_3=$103/1-3,

x=’Like;

etc.

There are many tools you can use to substitute text and figures which are particularly useful for repetitive script that you want. Furthermore, there are some really advanced tools that allow you to build templates or feed parameters into a piece of code to drive out powerful script.

Even basic use of the pre-processor will improve productivity for most projects by at least 20-30%.