I am writing a screen saver and trying to check whether it is already running so as to not allow multiple instances.
When the program is started I do this....
If FileType("C:\Program Files\Advanced\Running.sad")=1 Then End
fileout=WriteFile("C:\Program Files\Advanced\Running.sad")
CloseFile (fileout)
Wherever the program is ended, I do this....
DeleteFile "C:\Program Files\Advanced\Running.sad"
End
Is there a safer way to do this because as it is, if the program ends unexpectedly then the file won't be deleted.
When the program is started I do this....
If FileType("C:\Program Files\Advanced\Running.sad")=1 Then End
fileout=WriteFile("C:\Program Files\Advanced\Running.sad")
CloseFile (fileout)
Wherever the program is ended, I do this....
DeleteFile "C:\Program Files\Advanced\Running.sad"
End
Is there a safer way to do this because as it is, if the program ends unexpectedly then the file won't be deleted.