Would there be a way to return a variable type?
I would like to write a function to free the memory of a varaible
Variable type?
do you meen somethink like that:
TYPE MyType
a;b;c
ENDTYPE
GLOBAL _MyType[] AS MyType
...
FUNCTION MyFunction AS MyType: a, b, c
LOCAL t AS MyType
t.a = a
t.b = b
t.c = c
DIMPUSH _MyType[],t
RETURN t
ENDFUNCTION
or you meen:
FUNCTION Bla$
or
FUNCTION Bla%
or
FUNCTION Bla#
?
:)
Quote from: jessejohnston on 2010-May-08
Would there be a way to return a variable type?
I would like to write a function to free the memory of a varaible
What type of variable are you referring to that needs memory freed?
Thanks for the replies
Yes, I need something like a "TypeOf(variablename)" type function
If you trying to achieve reflection with GLBASIC, it is going to be difficult but I suppose not impossible. ;/ IE: If you are trying to find the type of a TYPE(object) during runtime.
what would you need the TYPEOF operator for?
Quote from: jessejohnston on 2010-May-08
Would there be a way to return a variable type?
I would like to write a function to free the memory of a varaible
Variables are stored as strings or numerals, and likewise inside a TYPE.
Thus, to free the memory of a variable you simply do this:
a$=""
a=0