Hi Konrad,

> I don't actually understand the  choMaster function or why I would
> actually need one?

I my experience, I often needed a 'choX' function for each class. If
not, where should new objects be taken from to insert them into other
objects? The only case would be if all data were automatically imported
without any GUI interaction, or created implicitly (see below).

In simple cases, it is not necessary to write a special 'choX' function.
If only a single index is used for the search, the generalized 'choDlg'
function can be used.


> the model I have is:
> 
> (class +Monster ...)
> (rel gear (+List +Joint) whos (+Item))
> 
> 
> (class +Monster ...)
         ^
Sould be '+Item' here?

>  (rel whos (+Joint) gear (+Monster))


> And I'm trying to add the list of Gear objects onto the Monster page.

That's why I think you might want to have a 'choItem' function, to add
the items one by one to the list in the monster object.

If, however, these items are not visible anywhere else, you indeed don't
need a choice function. Then you can create the '+Item' objects
implicitly, on the fly, like it is done for example with the order
positions '+Pos' in "app/ord.l". This is not really trivial, the chart's
'get' function must take care of that. Something like:

   '((L D)
      (cond
         (D
            (put!> D 'itm (caddr L))
            (put!> D 'pr (cadddr L))
            (put!> D 'cnt (; L 5))
            (and (; D itm) D) )
         ((caddr L)
            (new! '(+Pos) 'itm (caddr L)) ) ) )

This function receives a list 'L' for the values of all fields in that
row, and a (possibly empty) 'D' for the row's data (here: a '+Pos'
object). If 'D' is not empty (the first clause of the 'cond'), then an
existing position is being modified. Otherwise (the second clause), if
that row is not empty, a new '+Pos' object is created.


> So the master is always going to be the object in (: home obj). Do I

OK. As we discussed in previous mails, this is handled typically with
the '<id>' function.

> just wrap that up as an anonymous function?

If you mean something like the above 'get' function, yes.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe

Reply via email to