Hi David,

> Thank you for your prompt and helpful reply Alex.  The *JS trick worked
> great and the proper date calculation will be most helpful.  If I may ask a

One more thought: Perhaps a better way to calculate the age is to avoid
floating points, and do it directly in integer calculation:

   (de age (Birth)
      (setq Birth (date Birth))
      (let (Dat (date (date))  Age (- (car Dat) (car Birth)))
         (when (> (cdr Birth) (cdr Dat))
            (dec 'Age) )
         Age ) )

Here, the calls (cdr Birth) and (cdr Dat) each return a list of the form
(<month> <day>), so they can be directly compared.

> few more questions:
> You're right, storing the age is silly when already storing DOB.  How might
> I just calculate age on the fly and display it in the following (gui ...)
> or similar?
> (<grid> 6
>    ...
>    "Birthdate" (gui '(+E/R +DateField) '(dob : home obj) 10 *DOB)

         Note: the '*DOB' at the end is notneeded. You might pass
         another label here, which is probably not what you want.

I would use the '+View' prefix, for a read-only field. With the above
'age' function it gives:

      "Age" (gui '(+View +DateField) '(age (: home obj dob)) 10)

> Aditionally, how would I go about including a .css file to override certain
> bits of the built-in one?

Instead of a single CSS file, you can also pass a list of files:

   (html ... '("@lib.css" "my/lib.css") ...

As "my/lib.css" comes after "@lib.css", it will override styles in

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to