![]() |
VBScript - Sorting
In VBScript can the Array.Sort method be used? If not, do i have to build a loop to do the work? If that ends up being the case, how would I build a loop to do that?:confused: Just basic guidence would be cool.
|
vbscript lacks a sort function for arrays.
what can you do? here are your options, i recommend #1 1) use Javascript to sort an array for you. you can call a javascript function from within your vbscript like so :
<script language=JScript runat=server>here's some more helpful stuff at this link http://www.4guysfromrolla.com/aspfaq...Q.asp?FAQID=89 2)build your own - this works too but you're reinventing the wheel 3) use one someone else built in vbscript, a google search will turn this up, this works too. |
Melbolt, thank you for the info. What i ended up doing was using one that i found on a page, and just modified it to fit my needs. Let me show you what I used. I hate the variables used, but i eventually figured it out.
:
for i = 0 to ln - 1I cut and commented out the spare code. It bassically just sorts by the 3rd feild in the array, which is the second column. It works pretty good for what we were needing here at work. I do like that java insert idea though. I'll have to take advantage of that here soon. |
| All times are GMT -5. The time now is 4:23 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC