Using functions and variables

You can use functions and variables in your scripts.

Using functions

PocketBuilder provides built-in functions that act on menu items. You can use these functions in scripts to manipulate menu items during execution. For example, to hide a menu, you can use the built-in Hide function.

For a complete list of the menu-level built-in functions, look at the Function List view or use the Browser.

NoteDefining menu-level functions You can define your own menu-level functions to make it easier to manipulate your menus. One way to do this is by selecting Add from the pop-up menu in the Function List view.

For more information, see Chapter 7, “Working with User-Defined Functions.”

Using variables

Scripts for menu items have access to all global variables declared for the application. You can also declare local variables, which are accessible only in the script where they are declared.

You can declare instance variables for the menu when you have data that needs to be accessible to scripts in several menu items in a menu. Instance variables are accessible to all menu items in the menu.

For a complete description of variables and how to declare them, see the PowerScript Reference in the online Help.

Defining menu-level structures

If you need to manipulate a collection of related variables, you can define menu-level structures using the Structure view. You can do this by displaying the Structure List view and then selecting Add from the pop-up menu. The Structure and Structure List views are not part of the default layout.

For more information, see Chapter 9, “Working with Structures.”