Determining variables?
#6

Yes, but the problem is before you convert a integer or float to a string, you have to know if it's either a integer or float beforehand... so that makes this function useless.

At this moment you can only pass strings, if you enter a variable that is a integer or float it will give you a Tag-Mismatch error:

pawn Код:
new Integer = 540;
new Float:FloatingPoint = 3.14;
new StringString[12] = "Hello";
new StringFloat[12] = "30.1391";

new Type0 = GetVarType(Integer); // this will result in a tag-mismatch error
new Type1 = GetVarType(FloatingPoint);  // this will result in a tag-mismatch error
new Type2 = GetVarType(StringString); // This will work and return '2'.
new Type3 = GetVarType(StringFloat); // This will work too and returns '1'.
Too bad there is no function (as far as I know) that converts anything (regardless the variable-type) into a string.
Reply


Messages In This Thread
Determining variables? - by Partner - 07.01.2015, 19:05
Re: Determining variables? - by Schneider - 07.01.2015, 19:12
Re: Determining variables? - by Partner - 07.01.2015, 19:29
Re: Determining variables? - by Schneider - 07.01.2015, 20:42
Re: Determining variables? - by Partner - 07.01.2015, 21:28
Re: Determining variables? - by Schneider - 07.01.2015, 21:43

Forum Jump:


Users browsing this thread: 1 Guest(s)