Changing a Variable Object's Current Value

This example shows you how to write a script that changes a Variable object's current value when clicking text at run time.

To change a Variable object's caption:

  1. Create a Variable object.
  2. Change the object's type to Long.
  3. Create a Text object.
  4. Using the Animations dialog box, animate the Text object's Caption using the Variable object's CurrentValue property as its data source.
  5. Right-click the Text object and select Edit Script from the pop-up menu.
  6. Enter the following code in the Text object's Click event:

Variable1.CurrentValue = Variable1.CurrentValue + 10

  1. Switch to the run-time environment and click the Text object.

    The caption of the Text object increments by 10 (as will the Variable's current value).

See Also

How Do I...