home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / xbase / library / fox / workgrp / sp_task.prg < prev    next >
Text File  |  1993-09-02  |  2KB  |  76 lines

  1. * Sample Schedule Plus code
  2.  
  3. * load the FLL
  4. SET LIBRARY TO foxmapi.fll
  5.  
  6. * start a mapi session
  7. hmapisession = 0
  8. retval=mplogon(0, "", "", 3, 0, @hmapisession)
  9.  
  10. * create cursors for recipients and tasks
  11. =mpcursor("MapiRecip", "")
  12. =mpcursor("SPlusRest", "")
  13.  
  14. * clear reciepient cursor and set initial values 
  15. SELECT mapirecip
  16. SET SAFETY OFF
  17. ZAP
  18. SET SAFETY ON
  19. APPEND BLANK
  20. REPLACE reserved WITH 0
  21. REPLACE recipclass WITH 0
  22. REPLACE name WITH  ""
  23. REPLACE address WITH  ""
  24. REPLACE eidsize WITH  0
  25. REPLACE entryid WITH  ""
  26.  
  27. * clear reciepient cursor and set initial values
  28. * note this cursor is setup to hold all tasks for the current date
  29. * because restdata is filled with a blank string.
  30.  
  31. SELECT splusrest
  32. SET SAFETY OFF
  33. ZAP
  34. SET SAFETY ON
  35. APPEND BLANK
  36. REPLACE reserved WITH  0
  37. REPLACE itemtype WITH  "Task"
  38. REPLACE resttype WITH  "All"
  39. REPLACE restdata WITH  ""
  40.  
  41. * start a splus session
  42. hsession = 0
  43. retval=spbegin(0, 0, 0, 0, @hsession)
  44.  
  45. * get the first task from the users schedule?
  46. lpszitemid=SPACE(1)
  47. retval=spfindnext(hsession, 0, "MapiRecip", "SPlusRest", "", 0, 0, @lpszitemid)
  48. WAIT WINDOW "return from SPFindNext = " + STR(retval)
  49.  
  50.  
  51. retval=spreadtask(hsession, 0, "MapiRecip", lpszitemid, 0, 0, "SPlusTask", "SPlusAssoc", "", "")
  52. WAIT WINDOW "return from SPReadTask = " + STR(retval)
  53.  
  54. SELECT mapirecip
  55. LIST
  56. SELECT splustask
  57. LIST
  58. SELECT splusassoc
  59. LIST
  60.  
  61. SELECT splustask
  62. GOTO TOP
  63. REPLACE TEXT WITH "Text = Hello from foxprow"
  64. REPLACE projctname WITH "ProjectName = Hello from foxprow"
  65. REPLACE priority WITH "9"
  66. lpszitemid = ""
  67.  
  68. retval=spsavetask(hsession, 0, "MapiRecip", "SPlusTask", "SPlusAssoc", "", "", 0, 0, @lpszitemid)
  69. WAIT WINDOW "return from SPSaveTask = " + STR(retval) + " TaskID = " + lpszitemid
  70.  
  71. retval=spend(hsession, 0, 0, 0)
  72. retval=mplogoff(hmapisession, 0, 0, 0)
  73.  
  74. SET LIBRARY TO
  75.  
  76.