Announcement

Collapse
No announcement yet.

Writelin command for file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Writelin command for file

    Hello,

    I am using the following:
    Monfichier.writeln(t60.getValue(0),",",t120.getVal ue(0),",",t240.getValue(0),",",td.getValue(0),",", tw.getValue(0));


    It is writing each variable on a separate line. Why is that? I thought this statement would write everything on one line and then press return so everything after that would be on the next line.

    -Mike

  • #2
    Hi,

    Do a web search for "javascript writeln" for more in depth info.
    Also search for "javascript text escape characters" to get special characters that add things like tabs ("/t") and line breaks ("/n")

    In javascript you use the plus sign to concatenate text

    Monfichier.writeln(t60.getValue(0),",",t120.getVal ue(0),",",t240.getValue(0),",",td.getValue(0),",", tw.getValue(0));

    Should be written as:

    Monfichier.writeln(t60.getValue(0)+","+ t120.getValue(0) +","+t240.getValue(0)+","+td.getValue(0)+","+ tw.getValue(0));


    Also, be careful of spaces inadvertently inserted into variable or function names like (t120.getVal ue(0)).

    Wayne
    Last edited by waynecd; 03-13-2014, 05:59 PM.

    Comment

    Working...
    X