home *** CD-ROM | disk | FTP | other *** search
- /* Pmcomm REXX Script to log on to CompuServe and capture new messages */
- /* from selected areas in the IBM OS/2 and IBM Com forums. Make changes */
- /* for your user id and password. These changes need to be made on line */
- /* 26 line 28. */
-
- Signal ON SYNTAX NAME SYNTAX_ERROR
-
- Parse arg port portname screen_handle dde_output dde_input semaphore
- Parse source . . fn .
-
- Expose_list = 'cr port screen_handle dde_output dde_input'
-
- /* This function registers the init_dll function with REXX. The */
- /* init_dll function will register the rest of the functions in */
- /* the rxpmcomm.dll. */
- Call RxFuncAdd "init_dll","RxPmcomm","init_dll"
-
- /* Required before any other rxpmcomm.dll functions are called. */
- Call init_dll
- cr = '0d'x
- crlf = '0a0d'x
- Call read_timeout "600000",port
-
- Call put_s "",port
- Call wait_fore "User ID: ",port,screen_handle
- Call put_s "xxxxx,xxx"||cr,port
- Call wait_fore "assword: ",port,screen_handle
- Call put_s "xxxx.xxxxx"||cr,port
- Call wait_fore " !",port,screen_handle
- capture_file = 'ibmos2.cap'
- conference = 'ibmos2'
- Call Capture_Mail (conference capture_file)
- capture_file = 'ibmcom.cap'
- conference = 'ibmcom'
- Call Capture_Mail (conference capture_file)
- Call put_s "off"||cr,port
- exit 0
-
- Capture_Mail: Procedure expose (expose_list)
- Parse arg conference file_name
- If file_name = '' then return 0
- If conference = '' then return 0
- Call put_s 'go '||conference||cr,port
- Call wait_fore "ss <CR> !",port,screen_handle
- Call put_s cr,port
- Call wait_fore " choice !",port,screen_handle
- Call put_s "2"||cr,port
- Call wait_fore " choice !",port,screen_handle
- Call put_s "2"||cr,port
- Call wait_fore " choice !",port,screen_handle
- Call put_s "1"||cr,port
- Call capture_on file_name,dde_output,dde_input
- Do Forever
- Call wait_fore "CHOICES !"," choice !","Press <CR> !",port,screen_handle
- match = result
- Select
- When match=1 then Call put_s cr,port
- When match=2 then
- Do
- Call capture_off dde_output,dde_input
- return 99
- End
- When match=3 then
- Do
- Call capture_off dde_output,dde_input
- return 99
- End
- Otherwise Call put_s cr,port
- End
- End
-
- /* Standard handler for SIGNAL on ERROR, will help in the debuging */
- syntax_error:
- fp = filespec("path",fn)
- fd = filespec("drive",fn)
- errormsg = 'REXX error' rc 'in line' sigl':' errortext(rc)
- errorfile = fd||fp||"SCRIPT.ERR"
- rc = lineout(errorfile,date() time() fn '-' errormsg)
- rc = lineout(errorfile,date() time() fn '-' sourceline(sigl))
- Exit
-