Question about types and pointers...

BlitzMax Forums/BlitzMax Beginners Area/Question about types and pointers...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Example of type-checking:
Type TMesh
   Method Morph();...;end method
End Type

Type TLight
   Method Shine();...;end method
End Type

global entity:TMesh=new TMesh

if TLight(entity) then TLight(entity).Shine() else TMesh(entity).Morph()


I see no usage for string-pointers in Bmax except you're talking to C/C++ code. So I can't imagine an example that makes sense. But maybe others can...

However, if I remember right you can create a pointer to a string using
global s$="a string"
global sptr:Byte ptr=s[0]


Jake