Sign in to follow this  
Followers 0
lsakizada

How to detect modified file before it saved?

3 posts in this topic

For instance

1) A file opened

2) Some text inserted into the file but without saving the file.

Is there a way to detect the status of the file?.


Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites



For instance

1) A file opened

2) Some text inserted into the file but without saving the file.

Is there a way to detect the status of the file?.

That doesn't actually make sense. If you FileOpen() for write, and then FileWrite() anything, it is already saved.

You probably mean you did FileRead() (or maybe _FileReadToArray()), changed data in memory, and want to track changes. That would be handled by a flag variable like:

Global $fDataChanged
Where you read the data into memory, add "$fDataChanged = False", and anywhere in your script where you change any of the data, add "$fDataChanged = True". When it is time to decide if it needs to be saved, it would just be:
If $fDataChanged Then

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

That doesn't actually make sense. If you FileOpen() for write, and then FileWrite() anything, it is already saved.

You probably mean you did FileRead() (or maybe _FileReadToArray()), changed data in memory, and want to track changes. That would be handled by a flag variable like:

Global $fDataChanged
Where you read the data into memory, add "$fDataChanged = False", and anywhere in your script where you change any of the data, add "$fDataChanged = True". When it is time to decide if it needs to be saved, it would just be:
If $fDataChanged Then

:)

I think you missed my point.

I am actually openning excel file, and typing some text into a cell.

At this point I want to know that the file modified with no save.

I want to know that status since my application is crashing inside the excel UDF file.

here is a link to my example with reproduction steps.


Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0