E enonod Well-Known Member Licensed User Longtime User Feb 15, 2013 #1 I am trying to check a list to see if a particular instance of a Type, of many in the list, is present. If I do the following... Type Coords(X as Byte, Y as Byte) ... Dim positions as List Dim posn as Coords ... posn.X=10 : posnY=15 positions.InsertAt(5, posn) why can I not... If positions.Get(5).X = 10 then
I am trying to check a list to see if a particular instance of a Type, of many in the list, is present. If I do the following... Type Coords(X as Byte, Y as Byte) ... Dim positions as List Dim posn as Coords ... posn.X=10 : posnY=15 positions.InsertAt(5, posn) why can I not... If positions.Get(5).X = 10 then
stevel05 Expert Licensed User Longtime User Feb 15, 2013 #2 You need to assign the contents to a temp variable of the correct type. Dim temp as Coords temp = positions.get(5) if temp.x = 10 then Upvote 0
You need to assign the contents to a temp variable of the correct type. Dim temp as Coords temp = positions.get(5) if temp.x = 10 then
E enonod Well-Known Member Licensed User Longtime User Feb 15, 2013 #3 Thank you stevel05, I understand that of course, but do not understand why I cannot do as I attempted inline because... positions.Get(5) refers to an Object I would expect to do as I suggested. Upvote 0
Thank you stevel05, I understand that of course, but do not understand why I cannot do as I attempted inline because... positions.Get(5) refers to an Object I would expect to do as I suggested.
stevel05 Expert Licensed User Longtime User Feb 15, 2013 #4 It won't know what type of object it is unless you tell it. via Tapatalk Upvote 0
E enonod Well-Known Member Licensed User Longtime User Feb 15, 2013 #5 Very reasonable thanks stevel05. Upvote 0