File writing issue

Recommended Posts

I have a function that opens a file, writes to it, and closes it. This function is triggered by a button. The problem I have is that AutoIt does not write to the file until I close the entire script/program. Any idea what I am doing wrong?