Copy A.MyType to B.MyType

Blitz3D Forums/Blitz3D Programming/Copy A.MyType to B.MyType

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

when you say 'quicker method' do you mean quicker to program or quicker on runtime?

if it's the former:

Function CopyTypeObject(TyepA,TypeB,FieldSelect,FieldParameter,); You may need to make Field Select and FieldParameter $,%,or # where applicable throguhout the entire function!
; The FieldSelect and FieldParameteer are a means to ONLY copy the instances where Field xxxx = yyyy
For Copier.TypeA = Each TypeA
   If Copier\FieldSelect=FieldParameter
      NewB.TypeB = New TypeB
NewB\Field1= Copier\Field1
NewB\Field2= Copier\Field2
NewB\Field3= Copier\Field3
NewB\Field4= Copier\Field4
NewB\Field5= Copier\Field5
;...and so on
End If

Next

End Function



((Hope this helps, Ive not tried it or anything, just wrote it here in browser window!))