Recent

Author Topic: Text file and Timer  (Read 485 times)

Ilya83

  • New member
  • *
  • Posts: 8
Text file and Timer
« on: November 05, 2025, 07:06:19 pm »
A little help please. I have a Timer and each tick I want to open file, write some data and close file.
Don't get it How to do it using Lazarus...

So I opened file using rewrite command before Timer procedure, but I can't close it within Timer body.

I tried to keep it opened, but it's limited. It worked about 4h (Timer 10sec) and then it stopped. Probably OS limit.

Thanks in advance!
« Last Edit: November 05, 2025, 09:07:13 pm by Ilya83 »

jamie

  • Hero Member
  • *****
  • Posts: 7493
Re: Text file and Timer
« Reply #1 on: November 05, 2025, 09:32:51 pm »
Dont leave the file open and stop the timer while ioing.

U should be using memory mapped file
The only true wisdom is knowing you know nothing

Ilya83

  • New member
  • *
  • Posts: 8
Re: Text file and Timer
« Reply #2 on: November 06, 2025, 05:15:26 pm »
Silly me! "Append, WriteLn, CloseFile" works perfect. This topic should be deleted. Sorry everyone.

 

TinyPortal © 2005-2018