home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a081 / 2.ddi / CTFXX.EXE / FOXFAX05.PRG < prev    next >
Encoding:
Text File  |  1993-05-14  |  2.5 KB  |  84 lines

  1. ***************************************************************************
  2. *   Program Name: FOXFAX05         Copyright: Magna Carta Software, Inc.
  3. *   Date Created: 05-01-92         Language: FoxPro v2.0+
  4. *   From an original idea by David Wohlferd
  5. *   Read a CAS fax queue
  6. ***************************************************************************
  7.  
  8. clear
  9. set escape on
  10. set talk off
  11.  
  12.  
  13. * Load the right library
  14. foxid = VERS()
  15. IF "2.0" $ foxid
  16.     SET LIBR TO ftf                 && Identified FoxPro 2.0
  17. ELSE
  18.     IF "2.5" $ VERS()
  19.         IF "Windows" $ foxid        && Identified FoxPro 2.5 for Windows
  20.             SET LIBR TO ftfw
  21.         ELSE
  22.             SET LIBR TO ftf25       && Identified FoxPro 2.5 for DOS
  23.         ENDIF
  24.     ENDIF
  25. ENDIF
  26.  
  27. do ftfhdr
  28.  
  29. PRIVATE ret, temp, chandle, fhandle, buff, flen
  30. DECLARE cas_type[7], cas_mode[4], cas_status[7]
  31.  
  32. cas_type[1] = "Send"
  33. cas_type[2] = "Receive"
  34. cas_type[3] = "Polled Send"
  35. cas_type[4] = "Polled Receive"
  36. cas_type[5] = "Group Send"
  37. cas_type[6] = "Group Polled Receive"
  38. cas_type[7] = "Undefined"
  39.  
  40. cas_mode[1] = "200x200 dpi, fax mode"
  41. cas_mode[2] = "100x200 dpi, fax mode"
  42. cas_mode[3] = "File transfer mode"
  43. cas_mode[4] = "Undefined"
  44.  
  45. cas_status[1] = "Successfully completed"
  46. cas_status[2] = "Waiting to be processed."
  47. cas_status[3] = "Number dialed or event in progress."
  48. cas_status[4] = "Connection made -- sending."
  49. cas_status[5] = "Connection made -- receiving."
  50. cas_status[6] = "Event was aborted."
  51. cas_status[7] = "Undefined."
  52.  
  53. chandle = 0
  54. fhandle = 0
  55. ret = cas_findfirst(CAS_ANY, 0, CAS_LOG, @chandle)
  56. =sbe(ret, 0, "findfirst")
  57. DO WHILE ret >= 0
  58.     =sbe(cas_open(chandle, 0, CAS_LOG, @fhandle), 0, "cas_open")     && open event
  59.     flen = FSEEK(fhandle, 0, 2)              && get file size
  60.     buff = SPACE(flen)                       && pre-allocate size of buff
  61.     =FSEEK(fhandle, 0)                       && goto top
  62.     buff =FREAD(fhandle, flen)               && read buffer
  63.     =cas_close(fhandle)
  64.     wait
  65.  
  66.     temp = ASC(SUBSTR(buff,1))+1             && Type
  67.     temp = IIF(temp<7,temp,7)
  68.     ? "Type:",cas_type[temp]
  69.  
  70.     temp = ASC(SUBSTR(buff,2))+1             && Mode
  71.     temp = IIF(temp<4,temp,4)
  72.     ? "Mode:",cas_mode[temp]
  73.  
  74.     temp = ASC(SUBSTR(buff,3))+1             && Status
  75.     temp = IIF(temp<7,temp,7)
  76.     ? "Status:",cas_status[temp]
  77.  
  78.     ? "Phone:", SUBSTR(buff,13,47)
  79.     ? "Destination:", SUBSTR(buff,240,32)
  80.     ? "Sender:", SUBSTR(buff,272,32)
  81.     ret = cas_findnext(CAS_LOG, @chandle)
  82.     ?
  83. ENDDO
  84.