Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014

    Multi-line database

    In the code below when adding text to the notes area I would like the text to look like this:

    hello
    this
    is
    me

    Insted of this:

    here's the code:
    function UpdateRecord(nID)

    --Capture input fields to update the record.
    local strWho = Input.GetText("account_Input");
    local strLog = Input.GetText("login_Input");
    local strPass = Input.GetText("password_Input");
    local strNote = Input.GetText("notes_Input");
    --Check to see that the above entries are valid

    if strWho ~= "" and strLog ~= "" and strPass ~= "" and nID > 0 then

    --Insert new account information
    SQLite.Query(db, "UPDATE accounts SET who = "..Enclose(strWho)..", login = "..Enclose(strLog)..", pass = "..Enclose(strPass)..", notes = "..Enclose(strNote).." where ID = ".. nID, nil);


    --Clear the Inputs
    ClearInputs();
    return 0;
    else
    Dialog.Message("Error", "Please provide an Account name, Login and Password before trying to Update an entry");
    return nID;
    end
    end

    How would I do this?

  2. #2
    Join Date
    Apr 2007
    Location
    Mar Sara
    Posts
    292
    Listboxes don't support new lines, you must manually split the string in a table and add each item in the listbox.

  3. #3
    Join Date
    May 2005
    Posts
    1,115
    He uses an input object. I don't know, for me, multiline strings work normally.
    Never know what life is gonna throw at you.
    (Based on a true story.)

  4. #4
    Join Date
    Aug 2003
    Posts
    2,427
    If you are using an input object and require it to return multiline values, then you have to tick the Multiline enabled property or you could set the property in code -
    as in the help file -

    Code:
    -- Create properties table (only include items that should be changed)
    tProperties = {};
    tProperties.Multiline = true;
    
    -- Set the properties of an input object
    Input.SetProperties("Input1", tProperties);

  5. #5
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Yes, sorry it is an input object. Thanks longedge, how would I apply your idea in the above code?
    Last edited by Bruce; 10-06-2007 at 09:52 AM.

  6. #6
    Join Date
    Apr 2007
    Location
    Mar Sara
    Posts
    292
    You right-click on the input object, open it's properties and set it as multi-line input.

  7. #7
    Join Date
    Aug 2003
    Posts
    2,427
    Quote Originally Posted by Bruce View Post
    Yes, sorry it is an input object. Thanks longedge, how would I apply your idea in the above code?
    In the properties dialogue for the input object on the settings tab, the multiline property is immediately under the "fonts" button. You have the option to enable multiline and then having done so you can specify whether you want scroll bars or not.

    Personall I'd only do it in code if there were a reason to change it at some time while the app is running. You might for instance be using the same input for a number of purposes and sometimes want multiline and other times not.

  8. #8
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    You right-click on the input object, open it's properties and set it as multi-line input.
    LOL duh! Ok I got it. Thanks

  9. #9
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    This was checked already.
    it must be somthing to do with the SQLite database.

  10. #10
    Join Date
    Apr 2007
    Location
    Mar Sara
    Posts
    292
    Then use something like $& instead of \r\n and replace it before writing to the input.

Similar Threads

  1. How to convert access database to sqlite database.
    By sside in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 07-22-2008, 07:44 PM
  2. Multi Line Dialog Text
    By thetford in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 12-13-2006, 08:30 PM
  3. Multi line Buttons??
    By CPG33 in forum AutoPlay Media Studio 6.0
    Replies: 6
    Last Post: 01-10-2006, 04:15 PM
  4. HOWTO: Build a Setup from the Command Line
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-08-2002, 01:43 PM

Posting Permissions

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