Difference between revisions of "Ds"

From Keyfax Wiki
Jump to: navigation, search
(Setup)
Line 23: Line 23:
 
This tells it to treat the value entered by the user as a number, then multiply it by the original value entered by the user.
 
This tells it to treat the value entered by the user as a number, then multiply it by the original value entered by the user.
  
Example if you enter 9
+
For example, if you enter the number 9
  
 
  Number 9 * Number(9) = 81
 
  Number 9 * Number(9) = 81

Revision as of 10:36, 8 April 2019

The ds function is used in a databox to recall the original value of that databox that was entered or populated. This is useful when you want to use the value of a databox multiple times in one expression.

These examples are available in the model scripts database provided when Keyfax is purchased.

Example One

The most simple example of this would be using it to square a number, multiply it by itself.

The script for this would look something like this.

Dsfunction1.png

The user is asked for a number to square, the expression Examples.ds.Square.value then makes the calculation and writes the result into the databox Script.Details which is then displayed in the message Example Message.DSSQR.

Setup

Script databox Examples.ds has an expression setup within as shown below.

Dsfunction2.png

Number * Number(ds)

This tells it to treat the value entered by the user as a number, then multiply it by the original value entered by the user.

For example, if you enter the number 9

Number 9 * Number(9) = 81

The result is written into Script.Details and output the message.

Dsfunction4.png

Dsfunction3.png

Example Two

Setup