Writing to an external file

doubtfiredoubtfire Member Posts: 60
I would like to write the value of certain variables at certain point of the code to an external file as a way to check value rather to display on screen. Could anyone tell me how to open a file (c:\File1.txt), write to it and close it ? Thank you.

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Hi

    Define a Variable MyFile as Datatype File

    MyFile.TEXTMODE := TRUE;
    MyFile.CREATE('C:\File1.txt');
    MyFile.WRITE(FORMAT(MyVar));
    MyFile.CLOSE;

    Hope this points you in the right direction :)


    Albert
  • doubtfiredoubtfire Member Posts: 60
    I would let you know if there is more questions. Thank you.
Sign In or Register to comment.