Hi Konrad,

> so here is the code I have so far:


As I don't have the setup to test it here, let me guess

>  (gui '(+Set +E/R +Chart) '((L) (filter bool L)) '(gear : home obj) 5
>                             '((Itm)
>                                 (with Itm)
>                                     (list This (: nm) (diestr (:
> level) (: notes))))

> 1. the data I get back always has default empty strings for all
> fields. even when I fill things in.

I see two problems

1. A paren too much after '(with Itm'
2. The list to put into the row doesn't match the fields. I suspect
   there should be another paren after 'level)'


>                             '((Data Itm)
>                                 (cond
>                                     (Itm
>                                         (put!> Itm 'nm (cadr Data))
>                                         (put!> Itm 'level (caddr Data))
>                                         (put!> Itm 'notes (cadddr Data))
>                                         Data)
>                                     ((car L)
>                                         (new! (car Data)
>                                             'nm (cadr Data) 'level
> (diestr (caddr Data)) 'notes (cadddr Data)) ) ) ) )

'(car L)' is not right here. Should be '(car Data)'.


> 2. the underlying code keeps crashing on:
> 
> (upd> This (val This) Val)
> 
> where this is an external symbol which seems to be my new Item.
> and Val is '(+Weapon +Item).

This is in the 'set!>' method, as called by the +ClassField. The values
of 'This' and 'Val' seem OK. What kind of error was it (i.e. the error
message)?

Perhaps this is simply a follow-up error because of the above?


I would first try this cleaned-up version:

   (gui '(+Set +E/R +Chart) '((L) (filter bool L)) '(gear : home obj) 5
      '((Itm)
         (with Itm
            (list This (: nm) (diestr (: level)) (: notes)) ) )
      '((Data Itm)
         (cond
            (Itm
               (put!> Itm 'nm (cadr Data))
               (put!> Itm 'level (caddr Data))
               (put!> Itm 'notes (cadddr Data))
               Data )
            ((car Data)
               (new! (car Data)
                  'nm (cadr Data)
                  'level (diestr (caddr Data))
                  'notes (cadddr Data) ) ) ) ) )
   (<table> NIL NIL
      '((NIL "Type") (NIL "Name") (NIL "Level") (NIL "Notes"))
      (do 3
         (<row> NIL
            (gui 1 '(+ClassField) '(curr)
               '(("Armour" +Armour +Item) ("Weapon" +Weapon +Item) ("Item" 
+Item))
            (gui 2 '(+TextField) 10)
            (gui 3 '(+TextField) 4)
            (gui 4 '(+TextField) 30)
            (gui 5 '(+DelRowButton)) ) ) ) )
   (scroll 3 T)

Note that I also moved '(scroll 3 T)' outside the table. Otherwise you
get illegal HTML. Instead, you might make a separate row with

      (<row> NIL (scroll 3 T))

after closing the '(do 3', i.e. outside the 'do' but still inside the
'<table>'.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to