home *** CD-ROM | disk | FTP | other *** search
- * Test code for Schedule+ Task functions.
-
- * load the FLL.
-
- SET LIBRARY TO foxmapi.fll
-
- * start a MAPI session.
-
- hmapisession = 0
- retval=mplogon(0, "", "", 3, 0, @hmapisession)
-
- * create cursors for recipients and tasks.
-
- =mpcursor("MapiRecip", "")
- =mpcursor("SPlusRest", "")
-
- * clear reciepient cursor and set initial values.
-
- SELECT mapirecip
- SET SAFETY OFF
- ZAP
- SET SAFETY ON
- APPEND BLANK
- REPLACE reserved WITH 0
- REPLACE recipclass WITH 0
- REPLACE name WITH ""
- REPLACE address WITH ""
- REPLACE eidsize WITH 0
- REPLACE entryid WITH ""
-
- * clear recipient cursor and set initial values
- * note this cursor is setup to hold all tasks for the current date
- * because restdata is filled with a blank string.
-
- SELECT splusrest
- SET SAFETY OFF
- ZAP
- SET SAFETY ON
- APPEND BLANK
- REPLACE reserved WITH 0
- REPLACE itemtype WITH "Task"
- REPLACE resttype WITH "All"
- REPLACE restdata WITH ""
-
- * start a SPLUS session.
-
- hsession = 0
- retval=spbegin(0, 0, 0, 0, @hsession)
-
- * get the first task from the users schedule.
-
- lpszitemid=SPACE(1)
- retval=spfindnext(hsession, 0, "MapiRecip", "SPlusRest", "", 0, 0, @lpszitemid)
- WAIT WINDOW "return from SPFindNext = " + STR(retval)
-
- * Read task into cursors.
-
- retval=spreadtask(hsession, 0, "MapiRecip", lpszitemid, 0, 0, "SPlusTask", "SPlusAssoc", "", "")
- WAIT WINDOW "return from SPReadTask = " + STR(retval)
-
- * Replace some field values to test save function.
-
- SELECT splustask
- GOTO TOP
- REPLACE TEXT WITH "Text = Hello from foxprow"
- REPLACE projctname WITH "ProjectName = Hello from foxprow"
- REPLACE priority WITH "9"
-
- * Set itemid to blank - this will cause SPSaveTask to create a new task
- * rather than update task that was read above.
-
- lpszitemid = ""
-
- * Create new task.
-
- retval=spsavetask(hsession, 0, "MapiRecip", "SPlusTask", "SPlusAssoc", "", "", 0, 0, @lpszitemid)
- WAIT WINDOW "return from SPSaveTask = " + STR(retval) + " TaskID = " + lpszitemid
-
- * Logoff from SPLUS and MAPI.
-
- retval=spend(hsession, 0, 0, 0)
- retval=mplogoff(hmapisession, 0, 0, 0)
-
- SET LIBRARY TO
-
-