Get your own customer support community
 

In case of case, break code

There really needs to be an "ignore case" argument (boolean) to enable/disable case sensitivity for find functions, notably the findByValue and findAllByValue functions for Collections. If one is attempting to find an item in a collection, case really should not matter, or at the very least, it should be up to the developer whether it matters or not. In the following example code, notice that if the case of the item to be found doesn't exactly match the contents of the collection, the find fails.

Example code:

var boolean foundItLower = false;
var boolean foundItUpper = false;
var int lowerindex;
var int upperindex;
var Collection myColl = new Collection(string);

myColl.add("One");
myColl.add("Two");
myColl.add("Three");
myColl.findByValue("One",<not set>,<not set>,upperIndex);
myColl.findByValue("one",<not set>,<not set>,lowerIndex);
foundItLower = lowerIndex >= 0;
foundItUpper = upperIndex >= 0;
dialog.message("lowerIndex: " + lowerIndex + "; upperIndex: " + upperIndex);
dialog.message("foundItLower: " + foundItLower + "; foundItUpper: " + foundItUpper);

One word: Aaargh! (This is not a line of code...)
 
silly I’m sensitive about cases like this.
Inappropriate?
1 person has this problem

User_default_medium