home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / bcklib2.zip / EXAMPLED.PRG < prev    next >
Text File  |  1993-01-16  |  2KB  |  71 lines

  1. /*
  2.     The source code contained within this file is protected under the
  3.     laws of the United States of America and by International Treaty.
  4.     Unless otherwise noted, the source contained herein is:
  5.  
  6.     Copyright (c)1990, 1991, 1992 BecknerVision Inc - All Rights Reserved
  7.  
  8.     Written by John Wm Beckner        THIS NOTICE MUST NOT BE REMOVED
  9.     BecknerVision Inc
  10.     PO Box 11945                      DISTRIBUTE ONLY WITH SHAREWARE
  11.     Winston-Salem NC 27116            VERSION OF THIS PRODUCT.
  12.     Fax: 919/760-1003
  13.  
  14. */
  15.  
  16. #include "beckner.inc"
  17.  
  18. FUNCTION ExampleD()
  19.    LOCAL dDate, nTemp := 100, cTemp := "Beckner Library"
  20.    PRIVATE dTemp
  21.  
  22.    dDate := date()
  23.    CLS
  24.    @ 1,0 say "Beckner Date Functions"
  25.    @ 3,0 say "Enter a date:" get dDate
  26.    READ
  27.    dTemp := dDate
  28.    CLS
  29.    ? "The beginning of the month is", dBegMonth(dDate)
  30.    ? "The end of the month is", dEndMonth(dDate)
  31.    ? "The beginning of the quarter is", dBegQuarter(dDate)
  32.    ? "The end of the quarter is", dEndQuarter(dDate)
  33.    ? "This is the", dDay2Str(day(dDate)), "of the month"
  34.    ? "There are", ltrim(str(dDaysInMonth(dDate))), "in the month"
  35.    ?
  36.    ? "Use dPicture will cause your date to be displayed as",;
  37.    transform(dDate, dPicture(dDate))
  38.    ? "but an empty date would be displayed as",;
  39.    transform(dEmpty(), dPicture(dDate))
  40.    ?
  41.    ? "1 year later is", dSame(dDate, 12)
  42.    ? "1 year ago   is", dSame(dDate, -12)
  43.    ?
  44.    ? "The date you entered is", dWord(dDate)
  45.    ? "Day of the year:", dDayOfYear(dDate)
  46.    WAIT
  47.    CLS
  48.    @ 1,0 say;
  49.    "The next fields let you press <+> to advance the date or <-> to decrease it."
  50.    @ 2,0 say;
  51.    "Note that using these keys in a field other than a date field is ignored."
  52.    @ 4,0 say "Numeric ............" get nTemp
  53.    @ 5,0 say "Date ..............." get dTemp
  54.    @ 6,0 say "Character .........." get cTemp
  55.    SET KEY 43 to dInc
  56.    SET KEY 45 to dDec
  57.    READ
  58.    SET KEY 43 to
  59.    SET KEY 45 to
  60.    CLS
  61.    ?
  62.    ? "Days gone in the month:", dDaysGoneM(dDate)
  63.    ? "Days gone in the quarter:", dDaysGoneQ(dDate)
  64.    ? "Is this a leap year?", if(dLeapYear(), "Yes", "No")
  65.    ? "Days left in the month:", dDaysLeftM(dDate)
  66.    ? "Days left in the quarter:", dDaysLeftQ(dDate)
  67.    ? "This date is in week #", ltrim(str(dWeekNum(dDate)))
  68.    ?
  69.    ? "END OF DATE FUNCTIONS"
  70. ENDFUNCTION
  71.