Yeah i understand that it makes no sense to do that. i didnt really
explain myself properly i dont think. Im not actually intending to use
it instead of the add method. hehe that would be kinda silly.
// Take this code for example.
dim j as collections.arraylist()
dim dgraphics as drawing.graphics
for i= 0 to 100
dim objPath = new drawing2d.graphicspath()
j.add(objPath)
objpath = nothing
next
// Now to access it
// i cant use it like this because it gives a compile error
for index = 0 to 100
j(index).addline(x1,y1,x2,y2)
next
// so it has to be access like this
for index = 0 to 100
directcast(j(index),drawing2d.graphicspath).addline(x1,y1,x2,y2)
next
// End of code
So either i use DirectCast or CType OR i create my own collection class
specifically to deal with this problem since i know that only one type
of object is going to be in there.
So my real question is, is the speed difference worth worrying about
between a direct call (like .add), or casting through directcast or ctype?
Keep in mind that this program is going to end up being fairly CPU
intensive in its drawing. And if you dont know the answer, thats ok. i
dont think anyone has actually done any research on it yet coz google
couldnt help me.
Thanks Heaps,
Matt