Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    16

    Creating a text file from user input -help :(

    Hiya, I want to create a program to take several sets of data from user input, store the data and finally combine the elements together in a single text file.

    I want to have three input fields comprising of a one line title, followed by a multi line summary and then finally a multi line body.

    The problem is I'm not sure how to get ams to insert carriage returns when I append the data

    Here's what I've done so far

    title = Input.GetText("Input1");
    summary = Input.GetText("Input2");
    body = Input.GetText("Input3");
    TextFile.WriteFromString("C:\\article.txt", title, false);
    TextFile.WriteFromString("C:\\article.txt", summary, true);
    TextFile.WriteFromString("C:\\article.txt", body , true);

    This looks clumsy to me too, my logic says I should do something like:

    Textfile.WriteFromString(C:\article.text", variable1, variable2, variable3, false);

    and have carriage returns inserted after each variable.

    Any suggestions would be gratefully received.

    Many thanks Rob

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    You just include "\r\n" at the points you wish to start a new line e.g.

    Code:
    Variable1 = "Hello."
    Variable2 = "This is the next line of your final file."
    Variable3 = "And in conclusion we have the last line."
    Variable_final_text = Variable1.."\r\n"..Variable2.."\r\n\r\n"..Variable3
    Last edited by longedge; 03-08-2008 at 08:41 AM.

  3. #3
    Join Date
    Apr 2006
    Posts
    16
    Thanks Longedge you are a star

Similar Threads

  1. Open a file and retrive the path and write it to a text file
    By Autoplayit07 in forum AutoPlay Media Studio 7.5
    Replies: 5
    Last Post: 11-27-2007, 12:50 PM
  2. New Setup Factory 7.0 (v 7.0.2.0) Available
    By Darryl in forum Setup Factory 7.0
    Replies: 9
    Last Post: 03-06-2005, 01:57 PM
  3. 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
  4. Can search allow manual browse even if file is found?
    By RichardShaw in forum Setup Factory 5.0
    Replies: 2
    Last Post: 08-28-2000, 06:08 PM
  5. Replies: 0
    Last Post: 08-17-2000, 02:29 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