TXT field dates problem

Shao Sean shaosean at unitz.ca
Fri Aug 30 04:08:01 EDT 2002

> many thanks :-) may I add that script to the button? txt field name is
"viestit" and that another where usres
> type text is "tekstit" (those are finnish language).

add my code to the card script (if there's nothing already there).. replace
"newMessages" with "viestit".. put in your "save" button

on mouseUp
  local dateTimeStamp
  convert the seconds to dateItems
  put it into dateTimeStamp
  addMessage dateTimeStamp, the text of field "tekstit"
  put empty into field "tekstit"
end mouseUp

> Hmmm may I sen that stack to You via email? I use revolution in PC
feel free to..

on addMessage pDateItems, pMessageToAdd
  local todaysDateItems
  lock screen
  convert the seconds to dateItems
  put it into todaysDateItems
  put pMessageToAdd & LINEFEED before field "newMessages"
  if ((item 1 of pDateItems = item 1 of todaysDateItems) AND \
      (item 2 of pDateItems = item 2 of todaysDateItems) AND \
      (item 3 of pDateItems = item 3 of todaysDateItems)) then
    -- it's today (item 1 = year, item 2 = month, item 3 = date)
    select char 1 to (the number of chars in pMessageToAdd) of field
    set the foregroundColor of the selectedChunk to "red"
  end if
end addMessage

there ya go.. nicely wrapped into a handler for you ;-).. any questions,
feel free to ask (i'm gonna be up for another 10mins then beddy-bye time)

More information about the Use-livecode mailing list