quickie about for/each types
Blitz3D Forums/Blitz3D Beginners Area/quickie about for/each types
| ||
i'm having a brainfart... could someone give my a quick A to my Q? :D lets say i have thistype props field x,y,z field name$ end type type otherProps field id field prop.props end type prop.props=new props prop\x=1 prop\y=2 prop\z=3 prop\name="chest" otherProp.otherProps=new otherProps otherProp\id=5 otherProp\prop.props=new props otherProp\prop\x=1 otherProp\prop\y=2 otherProp\prop\z=3 otherProp\prop\name="shield" ok, i know that looks fine.. here's my Q: if i then call for prop.props=each props ;process something next will that process the props subtype inside my otherProps type? also, will i get into trouble naming my pointer in otherProps the same as my pointer in the main program? is that clear or am i just being confusing??? thanks. |
| ||
Yes. No. It's clear. Blitz's internal object lists always contains all the objects for each type. Even if you have no pointers to an object. This is because Blitz keeps its own pointers secretly. Type foo End Type f.foo = New foo f.foo = New foo i = 0 For f.foo = Each foo i = i + 1 Next Print i |