Hi Kashyap,

On Tue, Dec 03, 2019 at 07:48:58PM -0800, C K Kashyap wrote:
> I'll need a little bit more help with Pilog in QueryChart - In the code
> below,

Could you in the future provide code which is formatted in a more readable way?
It is very hard to decipher. Better no spaces between lines, and indentations
and parentheses more to the standard (see the output of 'pretty' and 'pp').

If I try to fix it manually, I get (hope I did not destroy anything):

   (diaform '(Dst)
      (<grid> "--"
         "Name" (gui 'ttl '(+DbHint +Var +TextField) '(ttl > Task) '*Name 20)
         "Tags" (gui 'tags '(+Var +TextField) '*Tags 20)
         (searchButton '(init> (: home query))) )
      (gui 'query '(+QueryChart) *ROWS
         '(goal
            (quote
               @Names
               (filter
                  '((X) X)
                     (mapcar
                        '((X) (uppc (pack X)) )
                        (split (chop *Tags) " ") ) )
               @Gen
               (mapcan
                  '((Nm) (list 'nm '+TagNm Nm))
                  '(filter  # Commented?
                     '((X) X)  #??
                     (mapcar
                        '((X) (uppc (pack X)))
                        (split (chop *Tags) " ") ) ) )
               (select (@@)
                  ((@Gen (nm +Tag) tsk))
                  (^ @
                     (fully
                        '((Nm)
                           (find
                              '((This) (or T (member Nm (: nm nm))))  # T?
                              (; (-> @@) tgs) ) )
                        (-> @Names) ) ) ) ) )
         1
         '((This) (list This)) )

(I assume the quotes, T etc. are temporary tests)


> I get the tags as a list of space separated words in the *Tags
> variable.

That's all right, but better may be to use +ListTextField, it directly returns a
list of strings:

   "Tags" (gui 'tags '(+ListTextField) '("," " ") 20)


> I create the @Names and @Gen pilog variables using *Tags. As you
> can see @Gen uses @Names inside it but I am not sure how to reuse the
> definition of @Names inside the definition of @Gen. I tried wrapping the
> whole "gui" call inside a let binding but that does not seem to work
> either. What's the way out?

Sorry, I don't understand this. In which way does @Gen "use" @Names?

☺/ A!ex

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

Reply via email to