Hi Konrad,

> The code is still crashing and it has something to do with how I'm
> using the class field.

OK, I found two more errors:


1. The chart's put function should not set the class field to 'This'

   (list This (: nm) (diestr (: level)) (: notes))

but to the object's type (i.e. th list of classes)

   (list (type This) (: nm) (diestr (: level)) (: notes))


2. Then, the return value of the get function is wrong. It returns
   the 'Data' list (the visual representation):

         (put!> Itm 'notes (cadddr Data))
         Data )
      ((car Data)

   It must be the object 'Itm' in the current row

         (put!> Itm 'notes (cadddr Data))
         Itm )
      ((car Data)


With that, we have:

   (gui '(+Set +E/R +Chart) '((L) (filter bool L)) '(gear : home obj) 5
      '((Itm)
         (with Itm
            (list (type This) (: nm) (diestr (: level)) (: notes)) ) )
      '((Data Itm)
         (cond
            (Itm
               (put!> Itm 'nm (cadr Data))
               (put!> Itm 'level (caddr Data))
               (put!> Itm 'notes (cadddr Data))
               Itm )
            ((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)

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

Reply via email to