Bâshrat the Sneaky Posted January 22, 2005 Share Posted January 22, 2005 Hi,I guess I've found a very odd WPI bug...I'm installing the applications iTunes and iTunes Art Importer, as well as many other apps. But for some reason, WPI always places those two at the end of the config file (so when I use the config option, those are at the bottom instead of between the H and the J...)I've attached my WPI configuration.Any clues?P.S.: I DID move them up again, where they should be, but they were automatically moved to the end of config.js after using the config option...config.js Link to comment Share on other sites More sharing options...
CHANDER Posted January 22, 2005 Share Posted January 22, 2005 My guess would be that it does it in alphabetical order...caps first so that both of the names starting with a lowercase i would be at the end of the list...between the lower case h and j. Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted January 22, 2005 Share Posted January 22, 2005 (edited) Yeah that is my experience also so you will just have to figure out how you want to rename the files or deal with it.P.S. not trying to be rude or mean. Edited January 22, 2005 by kelsenellenelvian Link to comment Share on other sites More sharing options...
CHANDER Posted January 22, 2005 Share Posted January 22, 2005 Just a thought..maybe if you prefix all your names with something..like .:NAME:. to make it look fancy then the caps might not go in front of the lowercase...I dont know if this works its just a though... Link to comment Share on other sites More sharing options...
djbe Posted January 22, 2005 Share Posted January 22, 2005 Like Chander said, i think it's because of the value of chars when sorting...In many programming languages, you can get an integer value for a character:A = 63a = 97(Values might be wrong, but should be close ) It's just the ASCII value of the characters. Now when sorting, you check if the integer value is smaller than the other one:if (value1 < value2) then ...Maybe this could be fixed by simply converting each string to lower/uppercase before checking:temp1 = toLower(name1)temp2 = toLower(name2)... (get first char of each temp string)... (compare strings)But well, maybe this has already been implemented and the problem is something else... edit:After diggin a LITTLE into the script files of the WPI:in program.js, the ordering is done correctly (tolowercase and then check):function SortByProg(a, b){ position = "program.js"; var x = a.prog[0].toLowerCase(); var y = b.prog[0].toLowerCase(); return ((x < y) ? -1 : ((x > y) ? 1 : 0));}but in the configwizard.js (in the function wich writes to config.js): var sortedList = new Array(); for (i=1; document.forms("frmcfg"+i) != null; i++) { sortedList.push(document.forms("frmcfg"+i)); } sortedList.sort(byName);it seems that here, there is no converting to lower/uppercase... and the built-in sort function of javascript puts 'A' before 'a'. I could write a function wich sorts it correctly without converting to lowercase, but I think Hasi would prefer to do that... Link to comment Share on other sites More sharing options...
Astalavista Posted January 23, 2005 Share Posted January 23, 2005 why are u not usingordr[pn]=[0] Link to comment Share on other sites More sharing options...
djbe Posted January 23, 2005 Share Posted January 23, 2005 I don't think he has a problem in wich order progs are being installed, but in wich order the programs-configs are saved in config.js... Link to comment Share on other sites More sharing options...
Bâshrat the Sneaky Posted January 23, 2005 Author Share Posted January 23, 2005 I don't think he has a problem in wich order progs are being installed, but in wich order the programs-configs are saved in config.js...Indeed. And the fix you suggested would be great! (but in general it works great!) Link to comment Share on other sites More sharing options...
Recommended Posts
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