Difference between revisions of "Ds"

From Keyfax Wiki
Jump to: navigation, search
Line 32: Line 32:
  
 
[[File:dsfunction3.png]]
 
[[File:dsfunction3.png]]
 +
 +
==Example Two==
 +
 +
===Setup===

Revision as of 10:35, 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.

Example if you enter 9

Number 9 * Number(9) = 81

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

Dsfunction4.png

Dsfunction3.png

Example Two

Setup