The Documentation for While says:
Unless an explicit Return is used, the value returned by While is Null.
But how do I implement it? I'd like to build a function
f[..., k_:0]:= While[test(k), k++; ...] that tests a condition against increasing values of k starting from zero and eventually returns the value that makes test(k) return