Jump to content

odd WPI bug


Recommended Posts

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


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 = 63

a = 97

(Values might be wrong, but should be close :P ) 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... :P

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...