It's not working. There are still error:
Cannot convert AnsiString to TFileStream
Member identifier expected
ContPoint is assigned a value that is never used
Ok, thanks.
The problem is that it doesn't create folder (Timer). Folder has to exist. I have to create the folder before I will try to save something there. How to solve this problem? What is the way that it can make folder by itself? (sorry for my english if it is not understandable).
You get most you need, though something seems to be missing in the first function it is required to call the second function : void __fastcall TForm1::FormClose(int onee, int twoo, int threee, TObject *Sender, TCloseAction &Action)
Could you explain what (TCloseAction &Action) does in your code?
This will not work. void __fastcall TForm1::FormClose is a predefined event handler. It will not work to just change the signature. This event is called by the VCL when the form is going to be closed.
What do you actually want to do? I am sure there is an easy way.
Generally I want to make a program which will calculate the time we spend on computer:
1.During one session - I already did
2.In total (sum up our all sessions) - I try to do that
void __fastcall TForm1::Timer1Timer - calculate time
void __fastcall TForm1::FormClose - create file .txt and save the time therein
I want to send variables from 1st function to 2nd function and save them in the .txt file. At the second time program has to add 1st time + 2nd time to show up total time we spend on computer. To add variables they need to be int type (in this case) - not string.
You can create variables in your form class so all member functions can access them.
In your timer event you set the values and in the form close event you save them to disk.
No need to pass the variables around.
... and it doesn't work. Focus on "sum up/in total" part.
1.Start program for 5 seconds. Close
1.1.In .txt file I see "00:00:15"
2.Start program 2nd time for 5 seconds. Close
2.1.In .txt file I see "00:00:15". Same as 1st time. It should be 00:00:30.
I don't remember for how long I start program earlier but I saw "00:00:210". Interesting.
Could you tell me why?