Datatype of a variable  Initial values for variables

Chapter 3: Declarations

Variable names

In a well-planned application, standards determine how you name your PowerScript variables. Naming conventions make scripts easy to understand and help you avoid name conflicts. A typical approach is to include a prefix that identifies the scope and the datatype of the variable. For example, a prefix for an instance variable’s name typically begins with i (such as ii_count or is_empname), a local integer variable’s name would be li_total and a global integer variable’s name would be gi_total.

For information about naming conventions, see the User’s Guide.

X and Y as variable names

Although you might think of x and y as typical variable names, in PocketBuilder they are also properties that specify an object’s onscreen coordinates. If you use them as variables and forget to declare them, you do not get a compiler error. Instead, PocketBuilder assumes you want to move the object, which might lead to unexpected results in your application.





Copyright © 2004. Sybase Inc. All rights reserved. Initial values for variables

View this book as PDF