I want to find out if a function is called with an integer or a string containing an integer.
The best solution is to stop wanting that.
Generally speaking, a function which expects a number shouldn't care whether the number was supplied as a string or not, and a function which expects a string shouldn't care if you neglected to wrap a numeric-looking string in the proper quote marks.
If your function can be given either a number or a string and is supposed to do different things with each, consider rewriting it into two different functions, so the caller can choose which behaviour they want.
In reply to Re: Distiguishing arguments: number-strings vs real integer
by tobyink
in thread Distiguishing arguments: number-strings vs real integer
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |