September 19, 200223 yr Hi, I am run FMP 5.5 on Windows 2000. I have a button called CLOSE, the script behind this button is to check some validation/mandatory fields, if it found some invalid data, it will prompt the user to correct it, otherwise it will CLOSE the application. But when the user click File>Exit, it will quit the FMP without checking validation/mandatory fields. I asked FMP to execute the CLOSE script if the document is closed by checking off the Perform Script of "When Closing Menu" box from Edit>Preferences>Document. It runs the CLOSE script, but after that it quit FMP without checking the data. Here is some script steps in my CLOSE script ShowMessage: "Invalid Data" Halt Script Like I mentioned above, it shows the message, but it quit FMP even it has HALT script right after ShowMessage. What did I miss here? Thank you
September 19, 200223 yr You didn't miss a thing. That is the way FM works. The only ways to prevent the user from exiting FM are to 1) keep the user in a scripted loop with a pause statment between loop and end loop or 2) use a plug-in such as SecureFM to lock out the close box and quit options. -bd
September 19, 200223 yr What you need to do, is to use the sequence: If ["put your data validation check here"] LoopShow Message ["Some data are invalid.
September 19, 200223 yr this sort of thing works well in runtime solutions, because the close box is gone. instead, you have a quit button with a script that does something like this: If your_conditions_are _not_met Show Message [You must still do this and that before you can quit!] Button 1=Cancel Halt Script Else Quit application EndIf if you are running your solutions within FM, this may not work so well, but perhaps you can get your users to only use the buttons anyway.
Create an account or sign in to comment