Liz Posted September 10, 2003 Posted September 10, 2003 I have a product database that has about 15 different manufacturers. I need to have each sorted in a different way depending on the manufacturer. So I have created an If script to sort each different (ex: If manufacturer="Jetson's sprockets" and then sort)I get each product line sorted the way that it should, create the script, then test it. Everything is good, BUT when I go back later and try to do this the script either won't work at all, or it doesn't sort the items in the correct sorting order. I have done this for each of the 15 or so manufacturers, but it only messes up on some of them. Is there something that I am doing wrong?
-Queue- Posted September 10, 2003 Posted September 10, 2003 Only one Sort[Restore], Import/Export Records[Restore], Print Setup[Restore], Print[Restore], or Find [Restore] can be saved per script. Make each of your sorts into separate scripts and call them, based on the manufacturer, from your main script. Before creating each script, sort your records as desired and each script will permanently hold the particular sort.
Liz Posted September 10, 2003 Author Posted September 10, 2003 I have each one as a seperate script and then have a main script that calls the subscripts, that is where the problem is occuring. I was not sure if there is a limited number of subscripts that can be called so maybe it gets half way through and quits?
-Queue- Posted September 10, 2003 Posted September 10, 2003 Have you tested each of the subscripts by themselves? Find a small set of records, run the first sort script. Check whether it's correct by manually (Ctrl/Cmd-S or Records->Sort) sorting and checking the field order in the list. Repeat for each additional script. Or print definitions for all your scripts to PDF and check the sort order from there.
Liz Posted September 10, 2003 Author Posted September 10, 2003 Ok, I went through each of the subscripts and tested them individually and they worked fine. It seems to be something that happens when they are all put together. In the main script I have - Perform Script[subscripts,"Inwalls"] Perform Script[subscripts,"Channel Vision"], on and on 16 more times. I checked and made sure that "Perform sub-scripts" was checked on each. Could there be a problem with the if statements contradicting themselves? Do I need to have something in the subscript saying that once the if condition has been met, the script needs to stop? I have tried to use the manual and the help menu for help with these scripts, but I have to say that they are not very helpful, so I really appreciate your help
Liz Posted September 10, 2003 Author Posted September 10, 2003 I do notice that in the instances where they are not sorted correctly, they are sorted in alphabetical order, so something is telling it to do that. If it matters
-Queue- Posted September 10, 2003 Posted September 10, 2003 The 'Subscripts' option shouldn't matter if you've only one step in each subscript and none of them call other scripts. It is highly possible that multiple sorts are running. You need to ensure that each If[] is a unique instance. If they aren't, you need to reorganize your structure so that they are logically separate from each other. What is the criteria used to determine which sort to use?
Liz Posted September 10, 2003 Author Posted September 10, 2003 ok, I think that I got it fixed. I re-wrote the script so that my If[] were in the main script instead of the sub-scripts. It seems that was where the conflicts were occuring. Thanks for all of your help
Recommended Posts
This topic is 7748 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