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
end
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.

Try changing this line:
writeString(myFile, " " & "etc" & " " &
_system.date() & " " &
_system.time()) -- Append text to the file
to
writeString(myFile, " " & "etc" & " " &
_system.date() & " " &
_system.time()&RETURN) -- Append text to the file
Note that if you open the file inNotepad on a PC, it will
look strange
because of the way notepad handles line feeds. You can get
around it by
doing this:
winReturn = NumToChar( 13 ) & NumToChar( 10 )
writeString(myFile, " " & "etc" & " " &
_system.date() & " " &
_system.time()&winReturn) -- Append text to the file

Similar Messages

  • How to get text in Next line of Label

    Hi,
    I am trying to write a code where when I press Enter the text in the text box appear on next line of label. However every new text is getting printed on the same line..
    Here is my code:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ChatBox extends Applet implements ActionListener
      TextField firstNum, secondNum, resultNum;
      Label label1;
      String str1 = "Start Chatting";
      public ChatBox()
      //setLayout(new GridLayout(3, 2, 10, 15));
      setBackground(Color.cyan);  
      String message;
      message = "Start Typing and see the magic";
      setLayout(new GridLayout(2,1,10,120)); //, 10, 15));
      setBackground(Color.cyan);  
      firstNum = new TextField(5);
      firstNum.addActionListener(this); 
      label1 = new Label(firstNum.getText());
      add(label1);
      add(firstNum);
      public void actionPerformed(ActionEvent e)
      String newline = System.getProperty("line.separator");
      //String message = "Start Typing and see the magic";
      str1 = str1+ newline + firstNum.getText();
      firstNum.setText("");
      //message = message + str1;
      label1.setText( str1 );

    Is it not possible?
    Kindly guide with an alternative way to do this.

  • How to append to the previous line in a text?

    Hi,
    Can we append a previous line in a text? That is, my program goes to the next line of text in one loop but I need to go back to the previous line and append to it in the next loop. How can I do that? Is there a way to go to a specific line or previous line ( like \n for next line)?
    lakki

    1. Instead of thinking about "going backwards" consider delaying "going forwards". Don't write the newline character(s) until you are sure you're really done with a line.
    2. Instead of writing as you go along, put the output in a List<String>, so that you can edit it.

  • Asking about how server can handle client disconnection

    Dear sir/madam,
    i'm doing my final year project and it is about a java client/server big2 game.But now i have a difficulties in dealing with the server side.
    That is about how to take action on the serverside if the client suddenly disconnected.
    I have read many java client/server programming scripts.But all of them doesn't mention this problem.The scrpits only assume the client side never disconnect suddenly.
    I hope if you can give me some suggestions on this problem.

    For my mud written in java, I used TCP/IP for the connections. When a client connects, he gets his own thread. Those threads are held in a vector in a manager class. each tick of the server does a quick run thru the vector and if the current thread/socket its on is null or !isAlive() its remove from the vector(which in turn removes it from getting any more game updates. This removal can be caused by two things. The clients disconnects by accident(kills his game, locks up has an internet connection hiccup, etc.) or he uses the games "quit" method. The quit method calls a method that does any player saving of data, etc then closes the socket, and sets it to null. thus the manager sees this and removes him frm the vecotr list on the next server tick. Seems to work great form a mud and worked really well in a multiplayer applet game I had up for a while.

  • A question about how to recover text messages from iPhone

    I don't know how to recover text messages from iPhone,it is trouble for me to solve it,Have you any idea?I'm sorry about my English!!!

    If they have been backed up then restore them
    If not forget about them they are gone.
    Allan

  • Hi, may anyone tell me how to append text to a file's end?

    every time when i using FileOutputStream.write(byte[]) to add text to a file, the old content would be disappear. but my intention is append, not affect the old content. how to?
    thanx

    assuming it is a text file, read the text into a Reader, read the Reader's contents into a StringBuffer, close the Reader, append to the StringBuffer the new text and write it down to the file.
    regards

  • How to append text of one JTextPane to another JTextPaneacross the network.

    i am developing a chat software using client server architecture. i have a JTextPane on client end where the client types the message in multi colour,multi font and multi size formats. i can send the data to other clients but then i cannot send this formats in which the client wants to send the data. how should i achieve it. when i make the content type of the JTextPane then whatever client types it shows up properly but if i change the content type to text/html then what ever i try to type it just shows an <html> tag and doesn't show the text that the client types. i tried using the second content type with the idea of sending data to the server in html format so that when other clients JTextPane get it then it should display it that way. but it doesn't happen that way. ne suggestions?

    i am developing a chat software using client server architecture. i have a JTextPane on client end where the client types the message in multi colour,multi font and multi size formats. i can send the data to other clients but then i cannot send this formats in which the client wants to send the data. how should i achieve it. when i make the content type of the JTextPane then whatever client types it shows up properly but if i change the content type to text/html then what ever i try to type it just shows an <html> tag and doesn't show the text that the client types. i tried using the second content type with the idea of sending data to the server in html format so that when other clients JTextPane get it then it should display it that way. but it doesn't happen that way. ne suggestions?

  • How to append text to jtextpane

    i want to append the text to jtextpane,but i can't find the append() method like in jtextarea , is there any way to append the text to jtextpane

    Actually that should be:
    textPane.getDocument().insertString(...);

  • Texting...feel dumb asking, but how do I text with my Palm Pre?

    Sorry my first post on this great forum has to be such a newbie one, but no one in this area at the various Verizon offices know anything at all about the Palm Pre. All Blackberry brain-washed it seems. Anyway, I can't seem to find simple steps to texting and when I do what one person finally told me to do, it ends up as an AOL email.
    Help! and thanks, Kate
    Post relates to: Pre 2 p102una (Unlocked NA)

    The application you're looking for is the Messaging app. Open your keyboard and type mess (or if you forget that, typing sms will also show its icon). Tap the Messaging app and you're ready to text away!

  • Hi guys, I would like to ask about how to setting pop-up programatically (C#) whereas the pop-up allow us to unblock for spesific website, so far the way I know is doing manually by add Exceptions in the Content tab, Thanks for helps

    by setting programatically hoped each user not need to setting up their browser but just running the program

    Exceptions are stored in the permissions.sqlite database file, so you would need to add the correct entry to that file to add a specific exception. You can add an exception in Firefox to see with an SQLite manger extension or program which SQLite code you need to run to add that specific exception.
    *SQLite Manager: https://addons.mozilla.org/firefox/addon/sqlite-manager/

  • Hi, I would like to ask about how to capture data from real time loop.

    Hi,
    Here is some overvier of my project:
    I have done real time control using labview 9.0. I used PID controller.
    In order to optimise this controller, I need to capture data from my sensor(input) and actuator (output).
    1. For example while real time control is running. I need to capture 1000 sample data (sensor(input) and actuator (output)).
    Then I will used these data for PID optimisation on the other loop without intefere my real time loop.
    2. When PID optimisation is completed, I will sent its PID parameter to real time control loop.
    3. These operation is done in parallel.
    Anybody can help me to solve these. Your idea may solve my problem.
    TQ

    Typically you will have to use RT FIFO or Queue communication to avoid any impact to your time critical loop.
    Best regards
    Christian

  • HT5176 How do you go to "next line" or RETURN key in dictation on an iPad3?

    Using dictation on an iPad3 - how do you go to a new line (same as hitting the return key)?

    When using dictation I can't get "New Line" to work. It simply types this phrase! The "New Paragraph" command works, but adds all these additional spaces into my text. Has anybody got ideas on how to resolve? Is there another way to dictate a "return key"?

  • Can anyone tell me how to put text in SEPARATE LINE on a JButton

    please help. Thanks

    Here you go:
    JButton button = new JButton();
    button.setLayout(new BorderLayout());
    JLabel l1 = new JLabel("Line 1");
    JLabel l2 = new JLabel("Line 2");
    button.add(BorderLayout.NORTH, l1);
    button.add(BorderLayout.SOUTH, l2);Next time please provide the question in your thread, not only in the subject. A good subject woul've been: "Multiple lines on JButton".
    Thanks.

  • How to print text in two lines using REUSE_ALV_LIST_DISPLAY

    hai gurus,
    i want to print the heading of the column in two lines using the REUSE_ALV_LIST_DISPLAY fucntion module
    fro example if column is for DOCUMENT TYPE
                DOCUMENT TYPE
              shoudl be printed as
            DOCUMENT
              TYPE
    regards
    afzal

    Let me know if this helps...I don't know why the formatting is not working...
    <MODIFIED BY MODERATOR - RESPECT THE 2,500 CHARS LIMIT>
    Edited by: Sourav Bhaduri on Jan 15, 2010 2:37 AM
    Edited by: Sourav Bhaduri on Jan 15, 2010 2:42 AM
    Edited by: Alvaro Tejada Galindo on Jan 14, 2010 5:58 PM

  • How to point to the next line of  aninternal table

    Hello experts,i am studying webdynpro abap, i am trying to point to the last line of an internal table, then add 1, in order to insert just in that position a new line by calling the function module ZFM_INSERT_CANDIDATE,neither the method INSERT_CANDIDATE nor the function module ZFM_INSERT_CANDIDATE  throws any error,.
    The method testing just dont do anything. what could i try? the source is the following, :
    method INSERT_CANDIDATE.
    data: itab TYPE ztable_type,
    t_line type zperson-id_person.
    data: COUNTLINES type i.
    "itab = me->SELECT_CANDIDATE().T_LINE = LINES( ITAB ) + 1.
    DESCRIBE TABLE ITAB LINES COUNTLINES .
    COUNTLINES = COUNTLINES + 1.
    itab =  me->SELECT_CANDIDATE( ).T_LINE =  COUNTLINES .
       try.
         call FUNCTION 'ZFM_INSERT_CANDIDATE'
         EXPORTING
           id_candidate = t_line
           firstname = firstname
           lastname = lastname
           age = age
           telephone = telephone
           id_country = id_country.
         ENDTRY.
    endmethod.
    tnkx in advanced

    Hello Tashi, you are right , so i am pasting some images:
    method select_cadidate:
    FunctionMod  ZFM_insert_candidate:
    FUNCTION ZFM_INSERT_CANDIDATE.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(ID_CANDIDATE) TYPE  ZPERSON-ID_PERSON
    *"     VALUE(FIRSTNAME) TYPE  ZPERSON-FIRSTNAME
    *"     VALUE(LASTNAME) TYPE  ZPERSON-LASTNAME
    *"     VALUE(AGE) TYPE  ZPERSON-AGE
    *"     VALUE(TELEPHONE) TYPE  ZPERSON-TELEPHONE
    *"     VALUE(ID_COUNTRY) TYPE  ZPERSON-ID_COUNTRY
    *"  EXCEPTIONS
    *"      ZCX_EXCEPTION_T1OO_TXT
    DATA wa_person TYPE Zperson.
    wa_person-mandt = sy-mandt.
    wa_person-id_person = id_candidate.
    wa_person-firstname = firstname.
    wa_person-lastname = lastname.
    wa_person-age = age.
    wa_person-telephone = telephone.
    wa_person-id_country = id_country.
    TRY.
    INSERT into Zperson values wa_person.
    IF sy-subrc <> 0.
    "RAISE EXCEPTION TYPE ycx_exception_t100_txt
    "EXPORTING textid = ycx_exception_t100_txt=>ycx_insert_no_possible.
      WRITE: 'ERROR AL INSERTAR'.
    ENDIF.
    ENDTRY.
    ENDFUNCTION.
    If test the FM separately , it works:
    Finally, the table:

Maybe you are looking for

  • Adapter light stays on even after removing from MacBook Pro

    Hi, I have a MacBook Pro. I noticed something odd last night. When I remove the adapter from the MacBook Pro (you know, the magnetic end that attaches to the MacBook Pro), the light on the adapter still stays green/on. I actually have to unplug the a

  • Helix only works with external power

    Hello Just received my Helix and I have some issue, one of the biggest issue so far is that it will only power up and stay on with external power, when I dock it it works fine, if I undock it it will shut down, if I plug the power cord to the tablet

  • Timeline editing jerkiness - waiting for timeline

    This has always bothered me with PE but now I am editing a 4-camera timeline, and waiting for all the little timeline "frame images" to fill in every time I scroll or resize the timeline is killing me. Who knows how to disable the little frame pictur

  • You tube downloader is not working

    Use to be able to download a you tube video by clicking on the download button, now the download button no longer works

  • Can't pick photos from iPhoto as wallpaper

    Hi, The photo picker in System Preferences > Destop & Screen Saver doesn't work for photos in iPhoto anymore. It shows Apple, iPhoto and Folders but there is no content in iPhoto, nothing no Events no albums. And it doesn't seem to be loading (no bea