SOL stands for "selected object list" and it allows you to access the objects picked via events. When an object is created it becomes the only picked object of that type. Also the created object will not be accessible via "Sprite[index]" until the next frame.
Say there are no instances of the "Sprite" object.
System.Create('Sprite', 1, 45, 45)
Sprite.x=22 #this will cause an index error[/code:25n0pb6b]
[code:25n0pb6b]System.Create('Sprite', 1, 45, 45)
SOL.Sprite.x=22 #this will work[/code:25n0pb6b]
Your example will create 10 sprites and move the first 10 sprites not the created ones.
Ideally new objects are modified right after each are created. You can however create multiple objects save their references and modify them later.
[code:25n0pb6b]import random
newObjs=[]
for x in range(10):
System.CreateByName("spr", 1, random.randint(10,400), random.randint(10,400))
newObjs.append(SOL.spr[0])
for obj in newObjs:
obj.X = random.randint(10,400)
obj.Y = random.randint(10,400)[/code:25n0pb6b]
[quote:25n0pb6b]Is there a len() operator of any fashion?
len(Sprite) returns the number of Sprite objects excluding objects created that frame.
len(SOL.Sprite) returns the number of picked Sprite objects. It will return 1 after a sprite object is created.