' This program is a part of the WCLIST program, and is used to test
' to see if the caller needs to go and update thier WCLIST entry.
' It contains all the normal Wildcat! logon options first, then chains
' to the WCLIST LOGON program code (WCLLOGON.WCX) to perform the
' checking for expiration.

declare function commas(x as long) as string

dim today as datetime
dim i as integer
currentdatetime today

if not fastlogon then

  displaygroupfiles

  subtext 1, commas(nodeinfo.callernum)
  select case today.t.number\60
    case 0 to 719
      displayprompt 1365
    case 720 to 1079
      displayprompt 1366
    case 1080 to 1440
      displayprompt 1367
  end select
  print

  if formatdate(today.d, "mm/dd") = formatdate(user.birthdate, "mm/dd") then
    if not displayfile("birthday") then
      beep
      print
      print "Happy birthday @FIRST@!"
    end if
    activitylog "Birthday Greeting Displayed"
  end if

  hellofiles
  checknewsletter
  checkbulletins
  quoteoftheday
  checkmailatlogon

  chain "wcllogon.wcx"

end if

function commas(x as long) as string
  dim s as string
  s = str(x)
  dim j as integer
  j = len(s)-2
  do while j > 1
    s = left(s, j-1) + "," + right(s, len(s)-j+1)
    j = j - 3
  loop
  commas = s
end function
