Which do you think is better? Is there any sexier way to do this?:
t:tthing=CreateThing()
t:tthing=New tthing t.Create()
t:tthing=CreateThing()
t:tthing=New tthing t.Create()
Type Thing Function Create:Thing( argA%, so%, on%, n%, so%, forth% ) Local t:Thing = New Thing ' Do stuff with the parameters passed Return t End Function End Type
Strict Type TBOX Field Mass:Float,Size:Float Field name:String Method rename(newname:String) Print "renaming "+name+" to "+newname name = newname End Method Function Create:TBOX( Mass:Float=1.0, Size:Float=2.0, name:String="New Box") Local temp:TBOX = New TBOX temp.Mass = Mass temp.Size = Size Temp.name = name Return temp End Function End Type Local mybox:TBOX = TBOX.Create() Print mybox.name mybox.rename("Big Box") Print mybox.name