Greg G Posted February 15, 2008 Posted February 15, 2008 I have a simple script the shows a custom dialog that gives the user the choice of running one of two scripts. When I run either of these two scripts via this dialog they run very slowly. If I run them without going through this custom dialog they run almost instantaneously. I can't figure out what the problem is as I am making this work the same way I have for other scripts without any problems. Any ideas? Greg
Greg G Posted February 15, 2008 Author Posted February 15, 2008 Ok, I did some more testing and I found that the problem is really running the scripts via a button verses running them from the script menu or script manager. If I run it from a button it takes forever but if I run it from the menu it is fast. Could this be a bug? Greg
Fitch Posted February 16, 2008 Posted February 16, 2008 Is the button for sure running the same script? If so, is it passing in a parameter that does something different? Have you run it using the debugger to see what's going on?
Greg G Posted February 16, 2008 Author Posted February 16, 2008 Thanks for the reply Fitch. Yes the button is running the proper script and there are no additional parameters being used. I did run it with the debugger both ways and there was nothing I could learn from that. Both ways are the same in every way except the time it take to complete. It's very bizarre. Are there any known bugs relating to running scripts via buttons or using custom dialogs?
LaRetta Posted February 16, 2008 Posted February 16, 2008 Nope, no bugs associated with this type of functionality. If it's not script parameter, then it might be context at the moment of script fire. What is the name of the table and table occurrence where the button resides? You can determine that by going to Layouts > Layout Setup and see what it says under 'Show Records from'. Then determine the table and table occurrence of where you are when you fire the script from ScriptMaker. Different by any chance? If not, we'll probably need to see your file or at least the script itself. It is usually the little things that can trip us up. LaRetta :wink2:
Greg G Posted February 21, 2008 Author Posted February 21, 2008 I checked and the scripts are both activated and running on the same table. Here are the scripts. The selection script: Allow User Abort [ Off ] Set Error Capture [ On ] Show Custom Dialog [ Title: "Convert Measurements To Imperial"; Message: "Convert all records in the found set or just the current record to Imperial?"; Buttons: “All”, “Current”, “Cancel” ] If [ Get ( LastMessageChoice ) = 1 ] Perform Script [ “Convert All to Imperial” ] End If If [ Get ( LastMessageChoice ) = 2 ] Perform Script [ “Convert Current to Imperial” ] End If If [ Get ( LastMessageChoice ) = 3 ] Halt Script End If One of the two script choices: Allow User Abort [ Off ] Set Error Capture [ On ] Go to Record/Request/Page [ First ] Loop If [ Inventory::Measurement System = "Imperial (lbs / in)" ] Show Custom Dialog [ Title: "Error!"; Message: "A record that is already in the Imperial format has been found!" Perform a find and omit records with Imperial data and then run the function again."; Buttons: “OK” ] Halt Script End If Set Field [ Inventory::Length; Inventory::Length / "25.4" ] Set Field [ Inventory::Width; Inventory::Width / "25.4" ] Set Field [ Inventory::Height; Inventory::Height / "25.4" ] Set Field [ Inventory::Weight; Inventory::Weight * "2.2046" ] Set Field [ Inventory::Measurement System; "Imperial (lbs / in)" ] Go to Record/Request/Page [ Next; Exit after last ] End Loop
Recommended Posts
This topic is 6122 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