Variable Check
#5

You asked how you can check if a variable is a string or integer, but that doesn't really make sense because a string is an integer array! So your question must be a) How to get the tag of a variable (array or not), and b) How to determine if a variable is an array.

To determine the tag of a variable you can use tagof() which is a compiler function (like sizeof).

https://sampwiki.blast.hk/wiki/Keywords:Operators#tagof

You could use sizeof() to check whether or not a variable potentially is an Array. But it's only useful if the variable you are checking is existing by name (at that point you already know if it's an array or not..).

However these may be completely useless depending on what you are trying to do, so please be a bit more specific.
Reply


Messages In This Thread
Variable Check - by Arbico - 01.11.2017, 10:03
Re: Variable Check - by zMason - 01.11.2017, 12:18
Re: Variable Check - by CXdur - 01.11.2017, 12:57
Re: Variable Check - by Arbico - 01.11.2017, 14:13
Re: Variable Check - by NaS - 01.11.2017, 15:03
Re: Variable Check - by OneDay - 01.11.2017, 16:24
Re: Variable Check - by Arbico - 01.11.2017, 17:52
Re: Variable Check - by Gammix - 01.11.2017, 21:03

Forum Jump:


Users browsing this thread: 1 Guest(s)