variable type in a function

Blitz3D Forums/Blitz3D Beginners Area/variable type in a function

chwaga(Posted 2008) [#1]
is there a way that i could make a function like:
function operateitem(t.type)
for t.type = each type
t\x = 1
next
end function

??

the reason for this is that i need to operate a large amount of items using the same method, just different names, so rather than copying the code:



a billion times and chopping the names out and replacing them, I could just say:

operateitems(number1.genericitem)
operateitems(number2.genericitem)
operateitems(number3.weapon)

etc.

NOTE: each type of different kinds (genericitem, weapon, etc.) share the fields used in the proposed function.


Beaker(Posted 2008) [#2]
No, this isn't possible. You can't pass more than one type to a function. But I suspect there may be another way to make this nicer.


chwaga(Posted 2008) [#3]
crap...


chwaga(Posted 2008) [#4]
can i change the sub-type?


chwaga(Posted 2008) [#5]
the idea of using id's just occured to me, this thread is null and

VOID