Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2005
    Posts
    228

    a simple question...about newlines in txt files

    Hi all:

    I have a little doubt, when i use the TextFile.WriteFromString action how i get includes new lines Is possible the use of the \r \n characters for separating lines frenquently used for dialogs message? How i do that?
    Thanks in advance

    Example:
    line one
    line two
    line three
    ....

    Autoplmst6

  2. #2
    Join Date
    Oct 2002
    Location
    RealFake, RF
    Posts
    403
    Yup, dialog messages work in the same way.

    Instead of "your message here" which would result in:

    your message here

    You can type "your\r\nmessage\r\nhere" which would result in:

    your
    message
    here


    If you want the quotes, type ' before and after the quotes so typing '"your message here"' would result in:

    "your message here"

    You can even mix and match by typing 'your "message here"' which would result in a dialog message of:

    your "message here"

    Have fun!
    Last edited by Protocol; 04-23-2007 at 03:46 PM.
    "White-colla-AMS-gangsta."

  3. #3
    Join Date
    Dec 2005
    Posts
    228
    Thanks for reply:
    I think I explained bad what I was telling is how to write in txt adding newlines ...Sorry for the mistake

  4. #4
    Join Date
    Oct 2002
    Location
    RealFake, RF
    Posts
    403
    Ahhhh...still not totally clear, but yes, \r\n works in the TextFile.WriteFromString action. To do so you'd simply place the \r\n inside direct text quotes such as:

    "The cow jumped over\r\nthe moon"

    Which would result in:

    The cow jumped over
    the moon


    Or if you're dealing with variable string data, then you would simply join the variable name to the \r\n command within quotes so that:

    MyVariable1 = "The cow jumped over"
    MyVariable2 = "the moon"
    MyString = (MyVariable1.."\r\n"..MyVariable2);
    TextFile.WriteFromString (_DesktopFolder.."\\MyTextFile.txt", MyString, false);


    But if you're starting from scratch (creating a new text document from a blank or preformatted template), I'd recommend the TextFile.WriteFromTable action and create a more specific and easily editable line of code that would create the same effect such as:

    MyStringData = "Line Five";
    MyTable = {"Line 1", "Line 2", "", "Line 3", "Some other text", "Line 4", MyStringData};
    TextFile.WriteFromTable (_DesktopFolder.."\\MyTextFile.txt", MyTable, false);


    This would result in a text file on your desktop called "MyTextFile.txt" with the following lines:

    Line 1
    Line 2

    Line 3
    Some other text
    Line 4
    Line Five


    Pretty simple, yet powerful schtuff! Tables are much easier to work with when dealing with data in "virtual grids" and can be swapped back and forth with strings just as easily.I hope this helps...

    Protocol
    Last edited by Protocol; 04-23-2007 at 04:04 PM.
    "White-colla-AMS-gangsta."

  5. #5
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    You can also use the double bracket method:
    [[
    any text you have
    written in a specific format
    will appear as such
    ]]

    Good luck
    Yossi

  6. #6
    Join Date
    Dec 2005
    Posts
    228
    Ok, thanks for your kind help to both protocol and yossi

  7. #7
    Join Date
    Nov 2003
    Location
    Myrtle Beach, SC
    Posts
    155
    @ yosik:

    Well ... i never knew about the [[ ]] trick. Just tried it. Cool.

    Thanks

Similar Threads

  1. Hope this is a simple question
    By TristanD in forum AutoPlay Media Studio 6.0
    Replies: 4
    Last Post: 11-21-2006, 03:30 AM
  2. Unable to find software?
    By NigelLacey in forum Visual Patch 2.0
    Replies: 4
    Last Post: 10-11-2005, 10:35 AM
  3. method to index/compare user's files for update?
    By intel352 in forum Setup Factory 6.0
    Replies: 0
    Last Post: 01-15-2003, 03:08 PM
  4. INFO: Why Files are Renamed in the DATA Folder
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 03:36 PM
  5. Simple Question
    By joesoap in forum AutoPlay Menu Studio 3.0
    Replies: 1
    Last Post: 02-23-2001, 12:28 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