Converting an Action to Inline Xbasic

Description

We saw earlier how you can view the Xbasic code associated with any Action. Alpha Anywhere also allows you to convert an Action into Xbasic code.

Some of the examples in this guide require the "Learning Action Scripting" workspace. See Creating Your First Action Script to learn how to get the "Learning Action Scripting" workspace installed.

  1. Open the Lesson2 script in the Code Editor.

  2. Select the second Action, "Display a Message Box".

  3. Right-click and select Convert to Inline-Xbasic.

    images/converting_1.gif
    Before converting to Inline-Xbasic, Alpha Anywhere displays a warning dialog box. Once you convert an action into Xbasic, you can no longer use the Genie to edit the action. Instead, you have to use the Xbasic Code Editor.
  4. Click Yes. The "Display a Message Box Action" is now converted into a new type of Action called Inline Xbasic.

    • images/converting_2.gif
    • The action is called "Inline Xbasic" because this action type allows you to insert Xbasic within an Action Script.
    • images/converting_3.gif
  5. Click the Edit Action button to edit the Inline Xbasic Action to see how it looks. The Script Genie: Inline Xbasic dialog appears. Note that the Display a Message Box Genie no longer appears when we edit this action. In some cases, you might find editing the message box in its Xbasic form to be quicker and easier than in the Genie. For example, you might want to change the title on the message box. Looking at the Xbasic code in the Genie, you can see that the title for the message box is based on the variable title_var, which is set to "Welcome". Change the title to "Hello".

  6. Change title_var = "Welcome" to title_var = "Hello".

  7. Click Next > and Finish to complete editing the action.

  8. Click the Run button to test your changes.

Limitations

Desktop Applications Only