Book Image

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri
Book Image

LiveCode Mobile Development Cookbook

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (17 chapters)
LiveCode Mobile Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Subtracting numbers


Subtracting numbers using LiveCode is a simple task. To demonstrate how to subtract one number from another, we will create a user interface that accepts two numbers, and when the equals sign is selected, the results will be displayed.

How to do it...

Follow the steps in this recipe to create an interface and LiveCode script that subtracts one number from another:

  1. Open LiveCode and create a new main stack.

  2. Set the background color of the default card to black.

  3. Drag a new text entry field to the card and set the following properties:

    • Name: fld_nbr1

    • Width: 88

    • Height: 31

    • Location: 194, 53

    • Font: Courier

    • Text size: 18

    • Align text right

  4. Drag a second text entry field to the card and set the following properties:

    • Name: fld_nbr2

    • Width: 88

    • Height: 31

    • Location: 194, 95

    • Font: Courier

    • Text size: 18

    • Align text right

  5. Drag a third text entry field to the card and set the following properties:

    • Name: fld_nbr3

    • Width: 88

    • Height: 31

    • Location: 194, 151

    • Font: Courier

    • Text size: 18

    • Align...