Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475

    Load column records into input object (with multiline enabled) or paragraph object.

    Hello everybody

    I'm trying to load the records (SQLite database) of a column into a input object (with multiline enabled) or paragraph object. If i have to insert it into a listbox object it would be like this;
    ************************************************** *****
    ResultSearch = SQLite.QueryToTable(db, "SELECT FirstName FROM contacts");

    for n=1, ResultSearch.Rows do
    ListBox.AddItem("ListBox1", ResultSearch.Data[n]["FirstName"], "");
    end
    ************************************************** *****
    But if i use the same code to insert the results into input object (with multiline enabled) or paragraph object it will show only the last record of the search result;
    ************************************************** *****
    ResultSearch = SQLite.QueryToTable(db, "SELECT FirstName FROM contacts");

    for n=1, ResultSearch.Rows do
    Input.SetText("Input1", ResultSearch.Data[n]["FirstName"]);
    end
    ************************************************** *****
    or
    ************************************************** *****
    ResultSearch = SQLite.QueryToTable(db, "SELECT FirstName FROM contacts");

    for n=1, ResultSearch.Rows do
    Paragraph.SetText("Paragraph1", ResultSearch.Data[n]["FirstName"]);
    end
    ************************************************** *****
    So my question is how can this be solved?

    Thanks a lot

    Sside

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Try this

    for n=1, ResultSearch.Rows do
    contacts = contacts .. ResultSearch.Data[n]["FirstName"]) .. "\r\n";
    end
    Paragraph.SetText("Paragraph1", contacts)

    Dermot

  3. #3
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475
    Hello Dermot

    Thanks for your time but it doesn't work. A error shows up

    Attempt to concatenate global "contacts" (nil value)


    Thank you

    Sside

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Try setting the value of contacts before you use it

    Code:
    contacts = ""
    for n=1, ResultSearch.Rows do
    contacts = contacts .. ResultSearch.Data[n]["FirstName"]) .. "\r\n";
    end
    Paragraph.SetText("Paragraph1", contacts)
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  5. #5
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475
    Thanks TJ_Tigger

    It works

    Thanks a lot

    Sside

Similar Threads

  1. Input object loses focus after Internet
    By dthompson16 in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 08-26-2004, 07:55 AM
  2. Input object graying out
    By dthompson16 in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 07-28-2004, 07:28 PM
  3. Function: Test Whether An Input Object Is Empty
    By Lorne in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 06-08-2004, 02:18 PM
  4. INFO: Difference between the Media Player Object and the AVI Object
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-29-2002, 02:15 PM
  5. HOWTO: Make a Media Player Object Go Full Screen
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 11:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts