Variable Check
#8

You could add custom tags to variables while declaring, that's one way.

Here is what i mean:
PHP Code:
new Integer:myInt;
new 
String:myString[256];
new 
Float:myFloat// float already has it's tag
stock function({IntegerFloatString}:paramtag tagof param) {
    if (
tag == tagof(Integer:)) {
        
// its an integer
    
}
    else if (
tag == tagof(String:)) {
        
// its a string
    
}
    else if (
tag == tagof(Float:)) {
        
// its a float
    
}

There's another way of reading the variable as a string and then do a character check to determine its type.
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)