home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / libs / rxwiz / examples / clock.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1999-05-24  |  1.0 KB  |  45 lines

  1. /*just a simple clock window*/
  2.  
  3. parse arg screen
  4.  
  5. wiz.Snapshot=1
  6. res=OpenSurface("clock.wizard","WIZ")
  7. if res~=0 then call error(res)
  8.  
  9. win.PubScreen=screen
  10. win.FallBack=1
  11. win.Gads=2
  12. win.ID=1
  13. win.Activate=1
  14. win.SizeGadget=1
  15. res=OpenWindow("WIZ","WIN")
  16. if res~=0 then call error(res)
  17. ws=WindowSignal("WIZ","WIN")
  18.  
  19. timer=CreateTimer()
  20. ts=TimerSignal(timer)
  21.  
  22. mask=or(ts,ws)
  23.  
  24. rec=0
  25. do forever
  26.     if and(rec,ws)~=0 then exit
  27.     set.text=FormatDate(,"%d %b %Y   %H:%M:%S")
  28.     res=SetWizAttrs("WIZ","WIN","CLOCK","SET")
  29.     if res~=0 then call error(res)
  30.     call StartTimer(timer,0,950000)
  31.     rec=Wait(mask)
  32. end
  33. exit
  34.  
  35. /**************************************************************************/
  36. error:
  37. parse arg code
  38.     call PrintFault(IoErr(),ProgramName())
  39.     string=GetRxWizString(code)
  40.     if string=="" then string="(codice sconosciuto: " || code || ")"
  41.     if RXWIZERR~="RXWIZERR" then string = string  "(field:" RXWIZERR || ")"
  42.     say string "(" || "linea" SIGL-1 ||")"
  43.     exit
  44. /**************************************************************************/
  45.