Ben Ball Posted January 12, 2007 Posted January 12, 2007 I have a script that is fairly lengthy. I have put, at the start of the script... "Allow User Abort" Off However, the script can still be escaped (by pressing "esc" key) by the user during its function. Is there something I need to Add with this function in order to not allow the script to be aborted during its cycle.... Its causing me big problems.... Yes, I have tried it with User Abort ON too... Can Any one Help??
LaRetta Posted January 12, 2007 Posted January 12, 2007 Hi Ben, During this script, are you running any sub-script? It really would help to see the script. Allow User Abort [ Off ] should indeed stop the User from hitting [esc] and terminating the script. LaRetta
Ben Ball Posted January 12, 2007 Author Posted January 12, 2007 Hi LaRetta, NO, I don't have any SubScripts at all. The esc key just flashes when the script is working. I tried Pressing the script and watching through the script debugger.... However, I can still abort and it does'nt tell me too much.. The script is long bit I have the first part of it attached. Ben
LaRetta Posted January 12, 2007 Posted January 12, 2007 Hi Ben, I see a few issues: 1) You have no test that there are related records and 2) the multiple Ifs[] after End Of Checks is concerning, ie, I believe all of those tests can be combined in ONE If[] statement. I see nothing else in this portion of script you have presented. LaRetta
Ben Ball Posted January 12, 2007 Author Posted January 12, 2007 (edited) Thanks LaRetta, with reference to 1... The related table is the same table so I know there is a related record. With reference to 2. The problem with the script is there are so many conditions of which I need to check for... The multiple (if's) are necessary, there are if's within if's because they all fall under the first IF. But basically you are saying that this may be causing the problem?? But, However, I still can abort the script as soon as the script goes to the first IF. Regardless. Ben Edited January 12, 2007 by Guest
LaRetta Posted January 12, 2007 Posted January 12, 2007 (edited) "The multiple (if's) are necessary, there are if's within if's because they all fall under the first IF." If any condition failed within one single If[], it would fail just as easily. Example: If this or this or this ... And no, I'm not saying that's the problem here. I'm saying we need to see more of your script but the multiple Ifs[] aren't needed because there aren't different results required between each of them. :wink2: Edited January 12, 2007 by Guest
Ben Ball Posted January 12, 2007 Author Posted January 12, 2007 (edited) LaRetta, No problem.... I have copied the script into a blank file... Perhaps you may understand the mess I have gotton myself into.... Ben Script.zip Edited January 12, 2007 by Guest
LaRetta Posted January 12, 2007 Posted January 12, 2007 Holy dog spit, Ben! I'm sorry but I've never had a script such as this. That doesn't mean it isn't necessary but multiple warning flags are flying for me!! I'll tell you one thing ... you truly MUST [color:red]put protections on those GTRRs. If any of them fail (no related records) then your script can run on the wrong layout/table - very dangerous not to include test here. But, as you realize, you have more problems than that. Regardless, User Abort should NOT allow cancelling the script. What do I suggest? Step back, get clarity on paper and rewrite each piece as separate script. Test each script-piece thoroughly. I *believe* you have many Ifs which can be combined but I truly can't tell how (the file you presented, of course, trashed the *logic* when it trashed the tables and layouts). Can you walk us through the logic? Pretend you are explain to new person hired, exactly what you are doing. If we can get to the underlying logic, we *might* be able to help. I KNOW your script could be handled more easily, for example (keeping in mind that I have no field or table names to work with) You have: If [ DesignType = "Double" ] GTRR Set many fields End If If [ DesignType = "Triple" ] GTRR Set many fields End If But it might be something like: GTRR Set Field [ Case ( DesignType = "Double ; "Yes" ; DesignType = "Triple" ; "No" ] ... in other words, the grouping of your script can be optimized by including many conditions right within the Set Field[] steps. But I can't make any recommendations. Truly, even if I had your real file, I'd still need to understand your process and needs before I could help. And regardless, it would take time and effort; something I'm currently short on. Maybe others can help as well. LaRetta
Ben Ball Posted January 12, 2007 Author Posted January 12, 2007 LaRetta, Thankyou for your effortse Here.Ummmm. i think perhaps I have got carried away... This script has grown and grown and yes, the structure lost a bit perhaps. It is complicated though and its not easy to layout either... The conditions and combinations are cross referenced andninside out... However, it works for what I need but thanks for the advise... I have some pretty complex relationships going on in this solution and they definetely need protecting... This script was actually one of my first and not the best. I think I will re-visit this after I have sorted the abort function on an easier script. Ben
Recommended Posts
This topic is 6527 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now