No type member symbols are not accessible, but namespace members are
Hello, quick question.
So you can do a quick and dirty check if a type or sub/function exists like so:
Code: Select all
#ifdef mytype
print "mytype has been declared"
#else
print "mytype not yet declared"
#endif
#ifdef somefunction
print "somefunction has been declared"
#else
print "somefunction not yet declared"
#endif
type mytype
dim x as integer
declare sub dothing()
end type
sub mytype.dothing()
'Do nothing
end sub
function somefunction() as integer
return 0
end function
#ifdef mytype
print "mytype has been declared"
#else
print "mytype not yet declared"
#endif
#ifdef somefunction
print "somefunction has been declared"
#else
print "somefunction not yet declared"
#endif
'I want to do this:
'#ifdef mytype.dothing
sleep
Code: Select all
...
void _ZN6MYTYPE7DOTHINGEv( struct $6MYTYPE* THIS$1 )
{
label$2:;
label$3:;
}
...
Question: Can you get a type's member symbol in freebasic through the preprocessor? Or, another way of asking, is there any way to do the equivalent of this which doesn't currently work:
Code: Select all
#ifdef mytype.dothing
...do something