Join Curves

Hi
How  to create a macro to join curves that the points coincide?
Either can be the end point of one curve with the starting point of the other, or then have an equal segment.
Thank you.