I am using uLCD-70DT, Diablo 16, Visi, for my project.

I want the text file to contain:
Time: 1
Time: 2
Time: 3
Time: 4
The number increases every time the screen is touched.

These numbers will be replaced with time after connecting a RTC module.
But for now, I want to know how to write variables to .txt file. The variable here is the number of times the screen is touched (denoted by "x" in the project file).
Should I be converting "x" to string before writing it? If so, then how?

Here is my code: writing_deletable.zip

I am using:
 hndl1 := file_Open("qwe.txt", 'a');
            res := file_PutS("Time: ", hndl1);
            res := file_Write(x, 1, hndl1);
            res := file_PutC("\n", hndl1);
            res := file_Close(hndl1);
But the .txt file contains random things. Eg.
I have read through pages 302 of Diablo internal 4DGL function manual.
P.S: I do not understand buffers and pointers, if it is required, I will read about it.
Also, is it possible to read content of the .txt file from the display?
Attached Files