The Math point is used to process calculations and expressions using data from other points, such as a Boolean , Date/Time , Drop List , Edit , Logic or an Ultradrop point . A Math point is configured with a fixed, mathematical expression which can be used with many mathematical operators and functions to produce a result.
,
or
.
.
A variety of mathematical operators and functions are listed below, in order of precedence:
Symbol | Mathematical Operator |
---|---|
^
|
Power |
*
|
Multiply |
/
|
Divide |
&
|
Modulus |
+
|
Add |
-
|
Subtract |
Symbol | Conditional Operator |
---|---|
=
|
Equals |
!=
|
Not equals |
>
|
Greater than |
<
|
Less than |
>=
|
Greater than or equal to |
<=
|
Less than or equal to |
Symbol | Logical Operator |
---|---|
&
|
And |
|
|
Or |
?x:y
|
If/Else conditional statement in the form of
(conditional expression) ? (true expression) : (false expression)
.
Show More Details
A conditional statement has three parts; the
Example:
If the value of the Edit point
|
Symbol | Function |
---|---|
abs
|
Absolute |
inv
|
Inverse |
int
|
Integer |
sqrt
|
Square root |
log10
|
Log |
ln
|
Natural log |
exp
|
Exponential |
sin
|
Sine |
cos
|
Cosine |
tan
|
Tangent |
asin
|
Arcsine |
acos
|
Arccosine |
atan
|
Arctan |
deg2rad
|
Convert degrees to radians |
rad2deg
|
Convert radians to degrees |
irnd
|
Generates a random integer between 0 and x-1 (meaning that there are x possible values). |
frnd
|
Generates a random decimal between 0 and x inclusive. |
The Math point uses the local system's regional settings to determine the decimal character used for
decimal values;
.
or
,
. For the Mobile Data Anywhere Designer this is configured in
Control Panel > Regional Settings
and on the mobile device this can be configured by setting the device's language and keyboard region
which can vary depending on the platform and operating system.
The Math point can be configured in the Mobile Data Anywhere Designer to customise the behaviour of the point. Below is an example of the properties window for a Math point, opened in the Mobile Data Anywhere Designer.
This is where you can create the expression that will be evaluated by the Math point. The expression should
be a mathematical expression and can use any of the available
mathematical
,
conditional
and
logical operators
and
functions
. These can be inserted manually or can be quickly inserted using the
Insert Operator
dropdown box below the expression field.
The expression can also contain dynamic references to other points in the project in order to use those
points' values in the expression. References can be inserted manually, by using the target point's ID name
in the expression or can be inserted automatically using the
Insert Point Name
dropdown box below the expression field. If a referenced point has a blank value, the value will be treated
as zero.
The
Basic Points Sample
project contains examples of how to use many of the various points that are available. This project also contains a
page that demonstrates some of the ways that this point can be used in your projects.
In the sample project
basic_point_samples.ppc
there is a
Math Point
page which demonstrates a variety of uses for the Math point. Open this project in the Mobile Data Anywhere
Designer for a closer at how each point has been customised on each point's properties window.