home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / dos / tools / aurora21 / fulldate.aml < prev    next >
Text File  |  1995-08-10  |  2KB  |  62 lines

  1. /* ------------------------------------------------------------------ */
  2. /* Macro:        FULLDATE.AML                                         */
  3. /* Written by:   nuText Systems                                       */
  4. /*                                                                    */
  5. /* Description:  This macro displays the current date and time in     */
  6. /*               'full-format', i.e. "2:18pm Saturday, January 7,     */
  7. /*               1995", and prompts you to enter it into your text.   */
  8. /*                                                                    */
  9. /* Usage:        Select this macro from the Macro List (on the Macro  */
  10. /*               menu), or run it from the macro picklist <shift f12> */
  11. /* ------------------------------------------------------------------ */
  12.  
  13.   // compile time macros and function definitions
  14.   include  bootpath "define.aml"
  15.  
  16.   // get date and time in raw format
  17.   rawtime = getrawtime
  18.  
  19.   // note: getrawtime returns "YYYYMMDDWhhmmssuu"  where:
  20.  
  21.   // YYYY = year                    // hh = hour (0-23)
  22.   // MM   = month (1-12)            // mm = minutes (0-59)
  23.   // DD   = day (1-31)              // ss = seconds (0-59)
  24.   // W    = day of week (0=sunday)  // uu = hundredths of a sec (0-99)
  25.  
  26.   full_date =
  27.  
  28.       gettime + ' ' +
  29.  
  30.       // get day of the week
  31.       case rawtime [9]
  32.         when '0' "Sunday"         when '4' "Thursday"
  33.         when '1' "Monday"         when '5' "Friday"
  34.         when '2' "Tuesday"        when '6' "Saturday"
  35.         when '3' "Wednesday"
  36.       end
  37.  
  38.       + ", " +
  39.  
  40.       // get month
  41.       case rawtime [5:2]
  42.         when "01" "January"       when "07" "July"
  43.         when "02" "February"      when "08" "August"
  44.         when "03" "March"         when "09" "September"
  45.         when "04" "April"         when "10" "October"
  46.         when "05" "May"           when "11" "November"
  47.         when "06" "June"          when "12" "December"
  48.       end
  49.  
  50.       // get day of the month and the year
  51.       + ' ' + rawtime [7:2] + ", " + rawtime [1:4]
  52.  
  53.  
  54.   if wintype? "edit" then
  55.     if (okbox  full_date + ":  Enter into text?"  "Full Date") == "Ok" then
  56.       write full_date
  57.     end
  58.   else
  59.     msgbox  full_date  "Full Date"
  60.   end
  61.  
  62.