How can I make condition that checks Object Type
BlitzMax Forums/BlitzMax Programming/How can I make condition that checks Object Type
| ||
If I want to check whether an object is from a spcific type for examplePartical:Type_Partical If Partical is Type_Partical Then print "Its a partical" |
| ||
if type_partical(partical) print "it's a partical" (think I remember it being called casting if you want to search further) |
| ||
a type is always "down castable" type ta type tb extends ta type tc extends ta local a:ta = new ta local b:tb = new tb local c:tc = new tc if ta(a) then print "a is type ta" if tb(b) then print "b is type tb" if ta(b) then print "b can be type ta" if tb(c) then print "c can never be type tb" if tb(a) then print "this could not happen in Blitzmax, upper casting is not allowed there" bye Ron |