Format table cells with?

Jeanne A. E. DeVoto revolution at jaedworks.com
Thu Feb 2 19:45:51 EST 2006


At 8:09 AM -0800 2/2/2006, Bill Vlahos wrote:
>Is there a way to have it flag when what was entered isn't a valid 
>date? For example February 32, 2006 or Fuberry 2, 2006.

I don't think there's an easy way, no - you'd have to modify the 
revTable frontscript to add this. I think this modification will work 
(WARNING! NOT FULLY TESTED! ABANDON ALL HOPE YE WHO ENTER HERE! 
BACKUP! BACKUP! OK!):

In the revDateFormat handler, you'll see this:
   if (tValue is not empty) and (tValue is a date) then
    put revDateDisplay(pPrefixList,tValue,tgroup) into tFormattedValue
    revWriteCellValue pObject,txcell,tycell,tFormattedValue
  end if

Substitute this:
  if (tValue is not empty) then
    if (tValue is a date) then
      put revDateDisplay(pPrefixList,tValue,tgroup) into tFormattedValue
      revWriteCellValue pObject,txcell,tycell,tFormattedValue
    else -- not a valid date, and not empty
      revWriteCellValue pObject,txcell,tycell, \
         "<p><font color=" & quote & "red" & quote & ">" & tValue & "</p>"
    end if
  end if

If the value entered isn't a date, this leaves it unchanged but turns it red.
-- 
jeanne a. e. devoto ~ revolution at jaedworks.com
http://www.jaedworks.com



More information about the use-livecode mailing list