DroidDB Tip of the Month

DroidDB® Tip for November 2015

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? 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, DroidDB 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. DroidDB 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 MyApplication.ini file (in the application folder). The entries in the MyApplication.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 the form builder. DroidDB Report does not allow you to provide aliases for variables.

 

Back to List »

Visit our store

Top rated! I needed a solid database application development tool for mobile devices. I chose DroidDB for Android OS because it provided a way to get a strong product to market quickly. DroidDB is relational, gives me control over form layout, handles macros, and supports events. It works on all Android versions I have tried and is a great companion product to SYWARE’s VisualCE.

Mark Read, President
SyntegraTech, Inc.

signup for our newsletter