TattyDon Posted December 9, 2008 Posted December 9, 2008 Hi, Is there any way of using a variable to drive the sort command? I presently have a script which takes a script parameter and works out things like how the list is currrently sorted etc. This is all done through one piece of scripting and I don't need to rewrite the script every time I add a new sort criteria. What I currently have to do though is put a separate piece in for each sort criteria when it comes to the actual sort: pseudo code if$scriptparam="Week" Sort Records by week Ascending elseif scriptparam="Date" Sort Records by date Ascending I have to do that because in each sort you seem to have to select the sort criteria and there is no ability to pass the variable. What Id like to do is use the $scriptparam variable to drive the sort. e.g. Sort Records by $scriptparam ascending This would avoid the need to add to the ElseIf part of the script everytime I want a new sort field. Hope this makes sense! John
bcooney Posted December 9, 2008 Posted December 9, 2008 Unfortunately, sorting is still hard-coded and context specific. How I wish you could click a specify button and get to the calc engine in the Sort dialog. You could always sort by one field, and set that field when the sort column button is clicked. Watch out for techniques (and I've used them) that put field names in script parameters, etc. Change a field name, and your sort is broken!
Recommended Posts
This topic is 5829 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