Wow, many thanks to all of you for helping!
I slightly modified my function based on some answers and here's what I finally got:
(defun c:2DD (/ p1 p2)
(setq p1 (getpoint "\nPick 1. Point: "))
(setq p2 (getpoint "\nPick 2. Point: "))
(princ
(strcat
"\nDistance in XY-Plane: "
(rtos (sqrt (+ (sqr (dX p1 p2)) (sqr (dY p1 p2)))))
)
)
(princ)
)
(defun sqr(x)
(* x x)
)
(defun dX (p1 p2)
(- (car p2) (car p1))
)
(defun dY (p1 p2)
(- (cadr p2) (cadr p1))
)
Actually it's pretty much the same with some extra paragraphs for readability.
The reason why I use this instead of distance is simple:
I'm still in learning phase and I'd like to match my AutoLISP with my current knowledge (use only what I've learned so far) and I haven't played around with the distance function yet.
It may not sound logical to some of you, but this way I can visually see the coding progress in my functions.
Nevertheless I'll have a look at all of your suggestions.
Best regards