It is currently November 19th, 2018, 8:13 am

Using variables in a loop.

Discuss the use of Lua in Script measures.
User avatar
kyriakos876
Posts: 814
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Using variables in a loop.

kyriakos876 » May 1st, 2018, 8:30 pm

balala wrote: ...
  • If the Bang is before the open-write-close procedure, the bang writes the appropriate value into the file, but then the open-write-close procedure overwrites what the Bang wrote.
    ...
This is what doesn't make sense to me. For the procedure to be able to overwrite what the bang wrote, it means that it knows what was in the file before the bang occurred, which shouldn't be happening as the "io.open" hasn't been executed yet...
User avatar
balala
Rainmeter Sage
Posts: 7014
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using variables in a loop.

balala » May 2nd, 2018, 11:30 am

kyriakos876 wrote:This is what doesn't make sense to me. For the procedure to be able to overwrite what the bang wrote, it means that it knows what was in the file before the bang occurred, which shouldn't be happening as the "io.open" hasn't been executed yet...
No, I think the procedure can overwrite the content of the file, even if it doesn't know its content.