home *** CD-ROM | disk | FTP | other *** search
- ***************************************************************************
- * Program Name: FOXFAX05 Copyright: Magna Carta Software, Inc.
- * Date Created: 05-01-92 Language: FoxPro v2.0+
- * From an original idea by David Wohlferd
- * Read a CAS fax queue
- ***************************************************************************
-
- clear
- set escape on
- set talk off
-
-
- * Load the right library
- foxid = VERS()
- IF "2.0" $ foxid
- SET LIBR TO ftf && Identified FoxPro 2.0
- ELSE
- IF "2.5" $ VERS()
- IF "Windows" $ foxid && Identified FoxPro 2.5 for Windows
- SET LIBR TO ftfw
- ELSE
- SET LIBR TO ftf25 && Identified FoxPro 2.5 for DOS
- ENDIF
- ENDIF
- ENDIF
-
- do ftfhdr
-
- PRIVATE ret, temp, chandle, fhandle, buff, flen
- DECLARE cas_type[7], cas_mode[4], cas_status[7]
-
- cas_type[1] = "Send"
- cas_type[2] = "Receive"
- cas_type[3] = "Polled Send"
- cas_type[4] = "Polled Receive"
- cas_type[5] = "Group Send"
- cas_type[6] = "Group Polled Receive"
- cas_type[7] = "Undefined"
-
- cas_mode[1] = "200x200 dpi, fax mode"
- cas_mode[2] = "100x200 dpi, fax mode"
- cas_mode[3] = "File transfer mode"
- cas_mode[4] = "Undefined"
-
- cas_status[1] = "Successfully completed"
- cas_status[2] = "Waiting to be processed."
- cas_status[3] = "Number dialed or event in progress."
- cas_status[4] = "Connection made -- sending."
- cas_status[5] = "Connection made -- receiving."
- cas_status[6] = "Event was aborted."
- cas_status[7] = "Undefined."
-
- chandle = 0
- fhandle = 0
- ret = cas_findfirst(CAS_ANY, 0, CAS_LOG, @chandle)
- =sbe(ret, 0, "findfirst")
- DO WHILE ret >= 0
- =sbe(cas_open(chandle, 0, CAS_LOG, @fhandle), 0, "cas_open") && open event
- flen = FSEEK(fhandle, 0, 2) && get file size
- buff = SPACE(flen) && pre-allocate size of buff
- =FSEEK(fhandle, 0) && goto top
- buff =FREAD(fhandle, flen) && read buffer
- =cas_close(fhandle)
- wait
-
- temp = ASC(SUBSTR(buff,1))+1 && Type
- temp = IIF(temp<7,temp,7)
- ? "Type:",cas_type[temp]
-
- temp = ASC(SUBSTR(buff,2))+1 && Mode
- temp = IIF(temp<4,temp,4)
- ? "Mode:",cas_mode[temp]
-
- temp = ASC(SUBSTR(buff,3))+1 && Status
- temp = IIF(temp<7,temp,7)
- ? "Status:",cas_status[temp]
-
- ? "Phone:", SUBSTR(buff,13,47)
- ? "Destination:", SUBSTR(buff,240,32)
- ? "Sender:", SUBSTR(buff,272,32)
- ret = cas_findnext(CAS_LOG, @chandle)
- ?
- ENDDO
-