Hi all
I'm trying to compare two strings

(deffunction compare-comptment-function(?s1 ?s2)
(bind ?str-buff1 (new java.lang.String ?s1))
(bind ?str-buff2 (new java.lang.String ?s2))
(if (eq ?s1 ?s2) then
(return "FFF")
else if (call ?str-buff1 contains ?str-buff2) then
(printout t "COMES 1" crlf)
(return ?s1)
else if (call ?str-buff2 contains ?str-buff1) then
(printout t "COMES 2" crlf)
(return ?s2)
else
(printout t "COMES 3" crlf)
(return (str-cat ?s1 , ?s2))))

SO when i call (compare-comptment-function "CSEE" "CS") it should return "COMES 1" "CSEE"

(compare-comptment-function "CSE" "CSEEE")  it should return "COMES 2" "CSEEE"
 and (compare-comptment-function "AE" "CSE") it should return "COMES 3" "AE,CSE"

but it keeps going into first elseif loop in all the cases. please tell me what i'm doing wrong. thanks for the help.
-amit

Reply via email to