This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to dump an array to a text file using DSS?



Hi

I understand the DSS example Memory.js, which reads an array and dumps it to the trace (.xml) file.

Is there an example of how to dump data to a .txt file?

I guess one would use FileOutputStream, but I don't know much Javascript.  An example or snippet of code would help please.

Best regards

David

 

  • Hi David,

    Here's  snippet that my help you:

    var myFile = new FileOutputStream("C:/report.csv", true);
    var p = new PrintStream(myFile);
    debugSession.target.runAsynch();

    p.print(debugSession.expression.evaluate("VCOP_Sim_Status_Registers_Cummulative_VCOP_cyc_count"));
    p.print("\n");
    p.flush();

    I'll send you the full file by e-mail if you like.

    Tom