我用Google搜索ASP经典的自然排序算法无济于事的实现。最好我能找到的是从戴夫Koelle ,这是从SO一个问题。问题是,因为我需要实现这个算法在ASP经典,我没有使用某些功能,如
I have Googled ASP Classic implementations of the natural sort algorithm to no avail. Best I was able to find was from Dave Koelle, which was from a question on SO. Issue is that since I need to implement this algorithm in ASP Classic, I don't have access to certain functions such as
Collections.sort(你的名单,新AlphanumComparator());
在理想情况下,我想一个数组传递给一个函数,并将它返回到我的有序排列。
Ideally, I'd like to pass an array to a function and have it return to me the ordered array.
任何想法,我能做什么?
Any ideas as to what I could do?
感谢你。
推荐答案您还没有哪一种语言,你在ASP中使用指定的。通常情况下,这将是VBScript中。
You haven't specified which language you are using in ASP. Typically this would be VBScript.
不过,如果你使用JScript的,而不是那么你可以使用JScript中的数组对象,并使用它的排序方法。该方法任选地作为一个参数的比较器功能。
However if you were to use JScript instead then you can use JScript's array object and use its sort method. This method optionally takes as a parameter a comparator function.
var a = new Array(); // code to populate array a.sort(function() { // Comparator code returning (-1|0|1) });
有没有需要的一切转换为JScript中,你可以用用JScript公用事业从VBScript。
There is no need to convert everything to JScript, you can use utilities written in JScript from VBScript.
更多推荐
自然排序算法的实现困境
发布评论