Building a Simple Calculator
  • 12 Mar 2021
  • 1 Minute to read
  • Dark
    Light

Building a Simple Calculator

  • Dark
    Light

Article Summary

Example Lab Article
While Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released.


Overview

Example Lab Details

Version6.9.2
Root FolderExample Lab - Calculator Example
Modules None
DependenciesNone

This Example Lab Project demonstrates how to build a simple calculator capable of multiplication, division, addition, and subtraction. 


Explanation

This Example Lab project operates by using a form to gather the necessary user input, the "Evaluate Dynamic Expressions" step, and a form for displaying results. The first form, which gathers the user input for the calculator, requires the input of two numbers and the operation that is to be performed.  The form then outputs this data to be used by the "Evaluate Dynamic Expressions" step. However, the "Evaluate Dynamic Expressions" step requires that the input be a single string. To accomplish this, the input type needs to be set to "merge plain text". This allows the three outputs from the form to be combined into a single input for the "Evaluate Dynamic Expressions" step. Once the step has run completely it will output the result of the calculation. This result as well as the original calculator input is then displayed in the last form for the user to review before closing the form and ending the flow.

Reference Articles



Project Download

The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 6.9.2 or later using our Importing/Exporting article.




Was this article helpful?