Hello,

I'm trying to convert my js strings into parenscript code but I've a problem.

1) This works
(ps::ps
  (ps::chain $
             (post jsonServerUrl
                   (if (ps::@ data error)
                       (alert (ps::@ data error))
                     (progn
                       (alert "test1")
                       (alert "test2")
                       )))))
2) This works
(ps::ps
  (if (ps::@ data error)
      (alert (ps::@ data error))
    (loop for i from 0 to arLen
          do
          (ps::chain newil
                     (setAttribute "class"
                                   (if (= (ps::@ (ps:getprop data i) typedonnee) "tabgrouptype")
                                       "ui-state-default"
                                     "ui-state-default no-nest"))                            

                     ))))

3) but this doesn't work (the if clause of first example if replaced by the if clause of the second one)
(ps::ps
  (ps::chain $
             (post jsonServerUrl
                   (if (ps::@ data error)
                       (alert (ps::@ data error))
                     (loop for i from 0 to arLen
                           do
                           (ps::chain newil
                                      (setAttribute "class"
                                                    (if (= (ps::@ (ps:getprop data i) typedonnee) "tabgrouptype")
                                                        "ui-state-default"
                                                      "ui-state-default no-nest"))
                                      ))))))

Is there something wrong with my code?

Thanks

FD