home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 November / PCO_1198.ISO / filesbbs / os2 / tspg202s.arj / TSPG202S.ZIP / Scripts / CALCLEAR.CWX < prev    next >
Encoding:
Text File  |  1997-05-04  |  1.1 KB  |  58 lines

  1. /*
  2.  
  3.   calclear.cwx
  4.  
  5.   This script clears the calendar template (see calendar.cwx)
  6.  
  7.  Copyright 1997 by TrueSpectra Inc.                                  
  8.                                                                      
  9.  This code is provided purely for demonstration purposes and is not  
  10.  supported or under warranty.  Feel free to modify and examine this  
  11.  example script for your own purposes.                               
  12.  
  13. */
  14.  
  15.  
  16.  
  17. /* Load utility functions. */
  18. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  19. call SysLoadFuncs
  20.  
  21.  
  22.  
  23. if RxMessageBox("Are you sure you want to clear the current calendar?","Settings","yesno") ,
  24.     \= 6 then
  25.         exit
  26.  
  27. h = 0
  28. do day = 1 to 7
  29.     do week = 1 to 6
  30.         name = n||week||day
  31.         call settext name, ''
  32.         end
  33.     end
  34.  
  35. call settext month, ''
  36. call settext year, ''
  37.  
  38. exit
  39.  
  40.  
  41.  
  42.  
  43. /* set the text of a text object. */
  44. settext: procedure
  45. arg object, text
  46.  
  47. dh = CwGetHandleFromObjectName(CwGetCurrentView(), object)
  48.  
  49. if CwIsHandleValid(dh) then do
  50.     dah = CwGetRegion( dh )
  51.     call CwSetProperty dah, 'caption', text
  52.     end
  53.  
  54. return
  55.  
  56.  
  57.  
  58.