Object Command+ Type Conversion

Blitz3D Forums/Blitz3D Programming/Object Command+ Type Conversion

Hi, I am not quite sure if this dosen't belong in the beginners fourm but here it goes:

I am trying to write a verlet intergration library. So far I have only four basic functions: CreateParticle(x,y,z,mass) CreateConstraint(p1,p2,stretch) UpdateConstraints() and UpdateParticles() I am having trouble with the CreateConstraint func.

My code looks like this:
Function CreateConstraint(p1%,p2%,stretch#,length#=3)

	constraint.constraint= New Constraint
	constraint\p1=Object.particle(particle)
	constraint\p2=Object.particle(particle)
	constraint\stretch=stretch
	constraint\length=length
	
End Function
but blitz does not like the bit about

constraint\p1=Object.particle(particle)
constraint\p2=Object.particle(particle)


so basically my question is how can I fix this:-) If there is a way to do it without having to alter my constraint type with a field like

Type Constraint
Field particle.particle
Field otherstuff
End Type


that would be good

Thanks