john white ifc Posted January 29, 2002 Posted January 29, 2002 Poor "mallikai" who never got a response to his find and sort based on groupname, and poor me for writing an entire response before noticing the topic was closed. So darnit, I'm submitting this anyway, in hope mallikai could still use the help. Here's the meat of the question: quote: There are 9 employees and i have assigned each to a group and have made the appropriate passwords for them... however, i have not been able to figure out how to create a script that will find and sort based on their groupname? It is my impression that the find command performs the last find you did and you cannot set it to perform 9 different searches in one script? and here's my answer... _____________________________ There are two methods you can use to handle this problem, because there are two ways to program searches in a script. _____________________________ Method 1 You are accustomed to creating scripts that perform searches by means of a single command that says, code: Perform Find [ Restore ] and as you've realized, the search that gets "restored" when the command executes is the last one you did before you created the script. This means that you can only have one search per script. But let's say the same thing another way: if you can only have one search per script, then you have tohave one script for every search you've got. Now, you have nine different searches, and that means nine scripts. But how are you going to link them all together into something that says this? if it's robert then do the script that does the robert search if it's adam then do the script that does the adam search If you are familiar with the Perform Script step, which lets one script execute another script as a subroutine, then you're probably already guessing the answer. (If you're not familiar with it, then you should read up on it first.) So here's your solution. It involves 10 scripts altogether. Nine of them have names like, Find robert's records Find adam's records and each of those nine contains one single command: code: Perform Find [ Restore ] Of course, you program each one to the search appropriate to the name. The 10th script is the one that uses the group name to decide which of the 9 scripts to run. It will say, code: If [ Status ( CurrentGroups ) = "robert"] Perform Script [ Find robert's records ] Else If [ Status ( CurrentGroups ) = "adam"] Perform Script [ Find adam's records ] Else If [
Recommended Posts
This topic is 8334 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