Stuff Ive Just Learnt on Types

BlitzMax Forums/BlitzMax Tutorials/Stuff Ive Just Learnt on Types

Hardcoal(Posted 2013) [#1]
This stuff are not new for many advanced but its good short examples for some.

Remember, there are also beginners here


'---Getting an Object Type Name---'

Local Strm:TStream = New TStream
Local TypeId:TTypeId

TypeId = TTypeId.ForObject(Strm)
Print "ObjectTypeName " + TypeId.name()

'---Get Type ID By Type Name---'

Print "Type ID " + TypeId.ForName("TStream").ToString()

'---Looping threw all Type Fields and Getting There Names---'

Type Testor
	Field name:String
	Field FileName:String
	Field Lala:String
End Type

Local Fld:TField
TypeId = TTypeId.ForName("Testor")
For Fld = EachIn TypeId.EnumFields()
	Print "Field " + Fld.name()
Next