Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2006
    Posts
    38

    Save as a Text File

    hello

    I need some help, please

    When i generate a TXT file, the file is generate always whit the same name, in this case MyFile.txt, what i would like to do is when i push the button that i can define the name of the file to save. Is it possible to create?

    Code:
    Text1a = Paragraph.GetText("Paragraph1");
    Input1a = Input.GetText("Input1");
    -- Table--
    Result = {Text1a, Input1a}
    -- create text File --
    TextFile.WriteFromTable("C:\\MyFile.txt", Result, false);
    -- how to make appear a save as window?? ---
    tanks

  2. #2
    Join Date
    May 2005
    Posts
    1,115
    Here is the code:

    Code:
    Text1a = Paragraph.GetText("Paragraph1");
    Input1a = Input.GetText("Input1");
    -- Table--
    Result = {Text1a, Input1a}
    
    -- Browse --
    MyFile = Dialog.FileBrowse(false, "Save As...", _DesktopFolder, "All Files (*.txt)|*.txt|", "MyFile", "txt", false, false);
    
    if MyFile~="CANCEL" then
    -- create text File --
    TextFile.WriteFromTable(MyFile, Result, false);
    end
    Never know what life is gonna throw at you.
    (Based on a true story.)

  3. #3
    Join Date
    Jul 2006
    Posts
    38
    tks bule for your time and your help, but when i press save it gives me this error




    ERROR




    what i am doing wrong

    Tks

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    The variable MyFile that is returned by the Dialog.FileBrowse is a table. When you test to see if it has been cancelled or if you want to use that variable you have to tell it which row to compare or use.

    if MyFile[1] ~= "CANCEL" then

    TextFile.WriteFromTable(MyFile[1], Result, false)

    Tigg
    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
    Jul 2006
    Posts
    38
    Tanks TJ_Tigger and bule, it woks

Similar Threads

  1. how to save variables in text file???
    By Jonas DK in forum AutoPlay Media Studio 6.0
    Replies: 23
    Last Post: 09-23-2005, 06:33 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. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  4. 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