I'd like to be able to test in ACL whether a document has changed. Putting it another way, if the user closed the document, would they be prompted to save?
I believe the if statement needs to have an '=="1" for it to work.
This would only work as the document is being closed though. Once the document is saved, Epic would not know if the document had been modified or not (unless change tracking were turned on and you wanted to test for some value in that).
Jonathan, Epic automatically lets the author know if the file is modified. In the message bar in the lower right, you'll (or the author) will see a "MOD" (Epic using the modified function) and Epic will ask if you want to save the file on closing.
ACL doesn't have a boolean data type, just strings and integers; thus for locations where other languages would test a boolean, ACL tests whether a value is the number 0, the string "0", or the empty string, ", all of which evaluate as 'false'; everything else is treated as 'true'. So while "if (modified(doc) == 1)" would also work, the "==1" is unnecessary, since modified() returns 0 (false) if the document is not modified.
And, yes, once the document is saved, modified() will return 0. What modified() tests is whether the document contains changes that have not yet been serialized to disk via a save. I took that to be the point of the question. Apologies, if I misunderstood the question.
The modified function was what I wanted. I have an alias that connects up an ACL function to handle close events, and I wanted to know if the user would be prompted to save, so that I could make sure that some things had been done before saving.
Thanks, being more a document editor with a bit of programming experience, I wasn't aware of that. I'll give it a try in one of my scripts when I get a chance.