var bFound = false; var i = 0; while (!bFound) { if (aValues[i] == vSearchValue) { bFound = true; } else { i++; } }