2 Replies Latest reply on Mar 29, 2007 12:45 PM by Newsgroup_User

    Ask about how to append text on next line

      I'm writing lingo about log file. For example, i would like to write like this when a new entry is appended:

      etc 3/29/2007 8:34 PM
      etc2 3/29/2007 8:34 PM

      Here is the lingo:

      on mouseUp
      if objectP(myFile) then set myFile = 0 -- Delete the instance if it already exists
      myFile = new(xtra "fileio") -- Create an instance of FileIO
      openFile(myfile, the moviePath&"try.txt",0) --Open the file with R/W access
      myVariable = readFile(myFile)
      setPosition(myfile,getLength(myFile)) -- Set position to end of file
      writeString(myFile, " " & "etc" & " " & _system.date() & " " & _system.time()) -- Append text to the file
      closeFile (myfile) -- Close the file
      myFile = 0 -- Dispose of the instance

      The problem is the appended text is put together, instead of a line by a line. In fact, what I want is the appended text is put into next line everytime, not on the same line. Please help me to modify it, thanks.