November 26, 200223 yr How do I incorporate a sort step in a script which will specify the sort by fields. I have three butons on the main layout. Each button sorts the same data in three different ways... thanks
November 26, 200223 yr First set up your sort in the Sort dialog (under Tools) Then create your script using the Sort script step (be sure to select the option to "Restore Sort Order") The script will now remember the sort you set up a moment ago. If you wanted to change that sort setup, go back to the Sort dialog, set it up how you like, go back into the script, then close the script. It will ask you if you want to keep the previous sort information or replace it with that currently in use. Have fun!
November 26, 200223 yr Author The script will remember the sort order but.... If another user is accessing the DB and does not know the proper sort order... does each script remember a different sort order without having to change it in the dialog box every time? so that each button will sort according to its script step without dialog
November 26, 200223 yr yes, when you close the script dialog, it embeds the sort settings into the sort script step. You can have as many different sorts as you like, as long as they are in separate scripts.
November 26, 200223 yr A useful technique is to make a bunch of one-command sort scripts, named for what is being sorted, SortID, SortDate, SortCity, SortName, etc. Do the sort manually before creating each one, so it will remember that sort. In all scripts that need to sort a certain way, add a Perform Script (subscript) step that runs that particular sort order. The same technique can be used for frequent Finds that need to run in scripts. In general, you do a one-time setup of all needed Sorts and Finds, then use then as subscripts when needed. Steve Brown
November 26, 200223 yr Great idea! You could use this for page setup/printing too (especially if you use laser printers, receipt printers, label printers, etc!)
Create an account or sign in to comment