home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / UE311CMD.ZIP / CAL3.CMD < prev    next >
OS/2 REXX Batch file  |  1990-06-19  |  2KB  |  71 lines

  1. ;    CAL3.CMD:    Calendar Macro to display three months
  2. ;            Previous    Current        Next
  3. ;            Month        Month        Month
  4. ;            Asterics "**" replace the current date
  5. ;            in the current month
  6. ;            Inspired by m.cs.uiuc.edu!reingold who
  7. ;            did a calendar for GNUmacs
  8. ;            (C)opyright 1989 by Ian Ornstein
  9. ;            Last Update Fri Feb 17 1989
  10. ;    Permission is granted to copy, distribute and use this software
  11. ;    wherever Daniel M Lawrence's MicroEMACS is used.
  12. ;
  13. ;   Steps to solution
  14. ;
  15. ;    0.- Save context [save-buffer - restore-buffer wouldn't do it]
  16. ;    1.- Select buffer calwork
  17. ;        insert $time
  18. ;        parse Month day and year
  19. ;       2.- Create window to display calendar
  20. ;    3.- Do Current Month
  21. ;    4.- Mark Current Date
  22. ;    5.- Do Preceding Month
  23. ;    6.- Do Succeeding Month
  24. ;    7.- Restore context
  25. ;
  26. ;
  27. ;        Prolog - Setup for all months
  28. ;
  29. execute-file calutil.cmd
  30. run save-ctx
  31. run get-date
  32. ;        Do current month first so current day can be
  33. ;        easily marked
  34. run month-number
  35. run get-window
  36. set %ynum %curyear
  37. set %calcol 27
  38. run disp1mon
  39. search-forward %curday
  40. 2 backward-character
  41. overwrite-string "**"
  42. beginning-of-file
  43. ;
  44. ;            Do Preceding Month
  45. set %mnum &sub %mnum 1
  46. !if &equ %mnum 0
  47.     set %mnum 12
  48.     set %curyear &sub %curyear 1
  49. !endif
  50. set %ynum %curyear
  51. set %calcol 1
  52. run disp1mon
  53. ;
  54. ;            Do third month's Calendar
  55. set %mnum    %savemon
  56. set %curyear %saveyear
  57. set %mnum &add %mnum 1
  58. !if &equ %mnum 13
  59.     set %mnum 1
  60.     set %curyear &add %curyear 1
  61. !endif
  62. set %ynum %curyear
  63. set %calcol 53
  64. run disp1mon
  65. ;
  66. ;restore-window
  67. next-window
  68. run restore-ctx
  69. clear-message-line
  70. ;
  71.