mrc Documentation
michaels, ross & cole, ltd.
http://www.mrc-productivity.com/

 

 

Calculations in Servlets (m-Power Users Only)

 

Most calculations are created through the calculation option of the Application Options screen. These may use standard calculation functions and/or external objects to achieve the final result. In addition, there are certain reserved characters and special keywords, which may be used:

 

Alpha Fields

In m-Power, all alpha calculations that contain simple text (non-fields) require you to wrap the characters in quotations (“”).

For instance, if I wanted to create a calculation that prints out Simple Calc on each line, I would do this:

 

 

Concatenation with Calculations

To concatenate within a calculation, simply use the “+” symbol in between each field you wish to concatenate.

 

 

For example:

 

 

You can also concatenate other characters within your calculation. To add additional aspects to your concatenate, simply separate them with the “+” symbol.

 

Below I will create a concatenation that specifies the Description then a space, then a dash, then another space, then the Class:

 

Substring within a Calculation

Sometimes it is necessary to build a substring within a calculation within an application. To do this, use this structure &FIELDNAME.substring(A,B).

&FIELDNAME – Choose the field name you wish to substring.

A – The starting position of your substring (0 denotes the first position).

B – Is used to find the length of the substring by subtracting A from this value.  The equation reads B – A  = length of the substring.

 

For example, a calculation set up as below…

 

Will generate a substring of the Product Description field, starting in the first position, going for 5 characters (5 – 0 = 5)…

 

Additional Examples:

"NorwichCityFC".substring(7,11) returns "City"

"hamburger".substring(4,8) returns "urge"