Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

increment variable names

sorry for the noob question but, I want to read a db and create variables for each entry. I want to set the variables names like
var1
var2
etc.

How can I do this?

— asked May 3rd 2010 by Laney Dale
  • variables
0 Comments

1 Answer

  • var rows = db.execute('SELECT * FROM ?????');

    num=0;

    while (rows.isValidRow())
    {
    nameofvariable = 'name'+num;

    //push or do something with the variable before it changes it.
    num++;
    rows.next();

    }

    — answered May 3rd 2010 by Stan Thompson
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.