mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (January 2011)

Associating a Name with a Variable

Within your form, you may use variables. By just looking at the variable reference (@var(0), @var(1), etc.), there is no way to really know what kind of data it holds. Is it an employee id? An age? A record counter? Starting in Visual CE version 12.1, you can associate an alias (a.k.a. a name) with a variable.

When entering an expression (such as in an Assign step in a macro), you normally would write an expression like:

    @var(1) + 1
If you wanted to associate an alias with variable 1, Visual CE allows you to write the expression like this:
    @var(1, Age) + 1
The alias ('Age' in this case) can only contain characters, digits, and underscores; must not start with a digit; and be no longer than 15 characters long. Visual CE completely ignores the alias you provide, it is only there for your own documentation purposes. You don't have to provide one of these aliases, but you can if you want to.

Furthermore, you can make these aliases show up in a dropdown list that contains variables. You do this by putting entries in the WCEODBC.INI file (in the windows folder). The entries in the WCEODBC.INI file would look like:

    [Variables]
    0=Name
    1=Age
    2=Address
Again, the alias can only contain characters, digits, and underscores; must not start with a digit; and be no longer than 15 characters long. Please note: these aliases will NOT be checked against the aliases used in the @var(n, alias) expressions.

This aliasing only works in Visual CE. Report CE does not allow you to provide aliases for variables.


Previous Tips of the Month