Lists of function pointers

BlitzMax Forums/BlitzMax Programming/Lists of function pointers

jamesmintram(Posted 2005) [#1]
Hi everyone,
Ive been digging around blitzmax and im beginning to get to know whats going on.

The "object" class that is in the documentation, is everything derived from that in the same way .NET data types are? or is it only certain things?

There have been a few cases when I get compilation errors when trying to cast for example an int to an object. Is this possible?

Which brings me to the topic title, is it possible to push function pointers onto a TList?

Thanks!


N(Posted 2005) [#2]
Only types and strings are derived from the Object class.

So, casting an int to an object is not possible.

As for function pointers, I don't know but wouldn't count on it. I'd create a container class for them anyways, e.g.:

Type IFunction
     Global _list:TList
     Field func:Int( a, b, c, d )
     Field _link:TLink
     Method New( )
          _link = _list.AddLast( Self )
     End Method
End Type
IFunction._list = New TList



jamesmintram(Posted 2005) [#3]
Ok, thank you for your quick response!!