Hi all,

To test whether a thing

x is a number, I wrote the following:

if(not(IsObject(x))) // THEREFORE IS NUMBER OR (LENGTH >= 0) STRING

{

if(x = (x + 0)) // THEREFORE IS NUMBER OR CHARACTER (LENGTH = 1 STRING)

{

if(x != Asc(x)) // x IS A CHARACTER IF AND ONLY IF x IS ITS OWN UNICODE CODE POINT

{ // THEREFORE x IS OTHERWISE A NUMBER

if(x = Round(x))

{

return 1;

}

else

{

return 2;

}

}

}

}

return 0;

0: not a number, 1: an integer, 2: a non integer number.

and then afterwards discovered Bob Zawalich already wrote a similar method in utils. Mine is simpler and therefore faster probably. I'm wondering if anybody can think of any situation where they would produce different results, I haven't found any. But my method abuses the

Asc() method, which might be a bad thing...

Andrew