The type of a variable!!??
Is it possible to know the type of a variable using some function?
Example: Quote:
Thanks! |
Re: The type of a variable!!??
There is no reason to use such a function since the variable type cannot change at run-time. You'll have to explain what you are actually trying to do because your request doesn't make any sense.
|
Re: The type of a variable!!??
I want to make ONE function to reset the data in a enum separated, this enum have a lot of type variables.
Example: PHP Code:
*If i want to reset the data from "Alive": Reset_gPlayer(Alive); then the function resets that variable(Alive) in all "33"(32) gPlayers **If i want to reset the data from "Kills": Reset_gPlayer(Kills); then the function resets that variable(Kills) in all "33"(32) gPlayers Theoretically the function would look something like this: PHP Code:
If it had some function that returns the type of the variable, I could just do something like this: PHP Code:
I hope you understood my question now! Thanks...! |
Re: The type of a variable!!??
Quote:
So, you can simple set a boolean to 0. IMO, you should never be looping through variables of different types. I believe that in some other languages, you would create multiple functions with different headers to achieve something like this. Code:
myfunction(bool:bVariable)In your case, you can simply make one function to reset kills and another to reset the alive variable. |
Re: The type of a variable!!??
Quote:
PHP Code:
|
Re: The type of a variable!!??
@fysiks
Very nice!! Was anyone here on the forum at some tutorial (I think that is fixed) who had spoken it. I will try your tips, thanks! @KliPPy What is "tagof"? How does it works? ------------ Another question: What's the best way to reset all that enum data? |
Re: The type of a variable!!??
Quote:
PHP Code:
|
| All times are GMT -4. The time now is 21:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.