Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2006
    Posts
    25

    Help inputing text

    Hi guys, i'm kinda new to autoplay but i read this forum everyday fro your great projects and help. I need help with something i can't quite grasp yet. I need to on click to delete last line of text in a .lua file, then get text from input and automatically add = "", after the inputed text.
    I'm sorry if tis sounds counfusing, my main problem is that i cant add = "", automatically to the text file because ams won't allow it.

    help me out please!
    thank you in advance!

  2. #2
    Join Date
    Nov 2006
    Posts
    25
    i figured out how to combine the text from an input and automatically add = "", to it so now all i really need is to find a way to delete the last line of either a text or .lua file.

    any suggestions?

  3. #3
    Join Date
    Mar 2006
    Location
    Corpus Christi, Texas
    Posts
    132
    I think you should post the part you need help with. We all do things different so if you post it we can see the way your going and help that way.


  4. #4
    Join Date
    Nov 2006
    Posts
    25
    heres part of the code im using, it basically finds the text "};" in the specified text file and deletes it. Then it extracts the text from an input box and adds " = ""," to it and appends it to the end of the selected file. Then it adds "};" to the end of the file. My problem now is that when it looks for the text "};" it deletes the whole line it is located in, and when i add it back on it appends it to the end of the last line in the text file which means if i was to reedit it it would delete the last line. I need to find a way to append the text from an input into a new line in a text file. any suggestions would be great.







    -- Declare the location of your text file and the sting you are looking for
    g_MyTextFile = "AutoPlay\\Docs\\" .. strManufacturer .. ".lua"
    -- Create a global variable and assign a string to it
    g_SearchString = " };"

    -- Setup an empty table to hold the contents of your text file
    t_TextFile = {};

    -- Read the contents of your text file to the table (See help file for more info)
    t_TextFile = TextFile.ReadToTable(g_MyTextFile);

    local index;
    local line;
    for index, line in t_TextFile do
    if String.Find(line, g_SearchString, 1, false) == 1 then
    Table.Remove(t_TextFile, index);
    end
    end

    -- Write the results back to your text file
    TextFile.WriteFromTable(g_MyTextFile, t_TextFile, false);

    strInpData = Input.GetText("Input3")

    Input.SetText("Input3", ''..strInpData..' = "",')
    finadd = Input.GetText("Input3")
    TextFile.WriteFromString("AutoPlay\\Docs\\" .. strManufacturer .. ".lua", finadd, true);
    TextFile.WriteFromString("AutoPlay\\Docs\\" .. strManufacturer .. ".lua", g_SearchString, true);
    Input.SetText("Input3", "")

Similar Threads

  1. Example: Loading Paragraph Text Using a Timer
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 7
    Last Post: 11-25-2004, 05:10 PM
  2. Writing Text to a File
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-22-2003, 02:02 PM
  3. Display Text by Mouse Over of Image Object
    By jdanniel in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 04-30-2003, 12:05 PM
  4. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 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