for loop.object = each object
Blitz3D Forums/Blitz3D Beginners Area/for loop.object = each object
| ||
is there a way to make the "loop" global ? I need to loop through a type collection like this: for loop.object = each.object update_xy_pos() next -------------------------------- Function update_xy_pos() loop.object\x = 10 loop.object\y = 20 End Function |
| ||
Global loop.object But I dont think you can have a type called object, as it is a reserved blitz command. |
| ||
for loop.object = each.object update_xy_pos(loop) next ;-------------------------------- Function update_xy_pos(loop.object) loop.object\x = 10 loop.object\y = 20 End Function |
| ||
Do this: update_xy_pos(loop)to pass 'loop' (the current instance of type 'object') as an argument to the function update_xy_pos(). To receive the type reference at the function end, do this: function update_xy_pos(this.object) Have fun. |
| ||
great - thanks |