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

  1. *.............................................................................
  2. *
  3. *   Program Name: CTFUTIL          Copyright: Magna Carta Software, Inc.
  4. *   Date Created: 09-27-92         Language:  FoxPro 2.0
  5. *.............................................................................
  6. * Description: Data format routines for 'CommTools -- Fox' examples.
  7. * Do NOT run this file directly.  It is DOed by FOXCOMxx examples, starting
  8. * with FOXCOM04
  9. *.............................................................................
  10.  
  11.  
  12. * Define Pull-Down Bar and Pads
  13. DEFINE MENU main_menu IN SCREEN COLOR SCHEME 3
  14. DEFINE PAD p_ct_quit   OF main_menu PROMPT "\<Quit"      AT 00, 00
  15.     ON SELECTION PAD p_ct_quit OF main_menu =ct_quit(portid)
  16. DEFINE PAD p_ct_online OF main_menu PROMPT "\<Go Online" AT 00, 06
  17.     ON SELECTION PAD p_ct_online OF main_menu =ct_online(portid)
  18. DEFINE PAD p_ct_speed  OF main_menu PROMPT "S\<peed"     AT 00, 17
  19.     ON SELECTION PAD p_ct_speed  OF main_menu =do_speed(portid, 17)
  20. DEFINE PAD p_ct_dataform  OF main_menu PROMPT "\<Data Format" AT 00, 24
  21.     ON SELECTION PAD p_ct_dataform  OF main_menu =ct_dataformat(portid, 24)
  22.  
  23. * Define Windows
  24. DEFINE WINDOW w_term FROM 01, 00 TO SROWS()-4, SCOLS()-1;
  25.     IN SCREEN;
  26.     TITLE " FoxCom Terminal " DOUBLE COLOR SCHEME 7
  27.  
  28. DEFINE WINDOW w_status FROM SROWS()-3, 00 TO SROWS()-1, 79;
  29.     IN SCREEN;
  30.     TITLE " FoxCom Status " DOUBLE COLOR SCHEME 17
  31.  
  32.  
  33.  
  34. *
  35. * CT_DATAFORMAT(expN portid, expN dataparm)
  36. * Set the data format
  37. *
  38. FUNCTION ct_dataformat
  39.     PARAMETER portid, col
  40.     PRIVATE lrow
  41.  
  42.     lrow = WROWS() - 1
  43.     @ lrow, 0 CLEAR TO lrow, WCOLS()-2
  44.  
  45.     DEFINE POPUP pop_dataform FROM 01, col;
  46.         IN SCREEN;
  47.         SHADOW
  48.         DEFINE BAR 1 OF pop_dataform PROMPT " Data   "
  49.         DEFINE BAR 2 OF pop_dataform PROMPT " Parity "
  50.         DEFINE BAR 3 OF pop_dataform PROMPT " Stop   "
  51.  
  52.     ON SELECTION POPUP pop_dataform =_ct_dataformat(portid, BAR(), col+10)
  53.     =display_data_format(portid)
  54.     ACTIVATE POPUP pop_dataform
  55.     DEACTIVATE POPUP pop_dataform
  56.     RELEASE pop_dataform
  57. RETURN (0)
  58.  
  59.  
  60. FUNCTION display_data_format
  61.     PARAMETERS portid
  62.     PRIVATE dbits, pbits, sbits, speed, lrow
  63.     DIMENSION a_par[8]
  64.  
  65.     a_par[1] = "NONE"
  66.     a_par[2] = "ODD"
  67.     a_par[3] = "EVEN"
  68.     a_par[4] = "MARK"
  69.     a_par[5] = "SPACE"
  70.  
  71.     ACTIVATE WINDOW w_status
  72.     lrow = WROWS() - 1
  73.     dbits = get_parm(portid, DATABITS)
  74.     sbits = get_parm(portid, STOPBITS)
  75.     pbits = get_parm(portid, PARITY)
  76.     speed = get_speed(portid)
  77.     @ lrow, 35 SAY "Data: "   + ALLTRIM(STR(dbits))
  78.     @ lrow, 43 SAY "Stop: "   + ALLTRIM(STR(sbits))
  79.     @ lrow, 51 SAY "Parity: " + a_par[pbits+1]
  80.     @ lrow, 65 SAY "Speed: "  + ALLTRIM(STR(speed))
  81. RETURN (0)
  82.  
  83.  
  84. FUNCTION _ct_dataformat
  85.     PARAMETERS portid, dataform, col
  86.  
  87.     DO CASE
  88.         CASE dataform = 1
  89.             =do_databits(portid, col)
  90.         CASE dataform = 2
  91.             =do_parity(portid, col)
  92.         CASE dataform = 3
  93.             =do_stopbits(portid, col)
  94.     ENDCASE
  95.     =display_data_format(portid)
  96. RETURN (0)
  97.  
  98.  
  99.  
  100. *
  101. * DO_DATABITS(expN portid, expN col)
  102. * Show a menu that allows the user to set the number of data bits.
  103. * Called from data_format_menu()
  104. *
  105. FUNCTION do_databits
  106.     PARAMETERS portid, col
  107.  
  108.     DEFINE POPUP pop_databits FROM 01, col;
  109.         IN SCREEN;
  110.         SHADOW
  111.         DEFINE BAR 1  OF pop_databits PROMPT "  5  "
  112.         DEFINE BAR 2  OF pop_databits PROMPT "  6  "
  113.         DEFINE BAR 3  OF pop_databits PROMPT "  7  "
  114.         DEFINE BAR 4  OF pop_databits PROMPT "  8  "
  115.  
  116.     ON SELECTION POPUP pop_databits =_do_databits(portid, VAL(PROMPT()))
  117.     ACTIVATE POPUP pop_databits
  118.     RELEASE pop_databits
  119. RETURN (0)
  120.  
  121.  
  122.  
  123. FUNCTION _do_databits
  124.     PARAMETERS portid, dbits
  125.     PRIVATE ret
  126.  
  127.     ret = set_parm(portid, DATABITS, dbits)
  128.     DEACTIVATE POPUP pop_databits
  129. RETURN (ret)
  130.  
  131.  
  132.  
  133. *
  134. * DO_STOPBITS(expN portid, expN col)
  135. * Show a menu that allows the user to set the number of stopbits
  136. * Called from data_format_menu()
  137. *
  138. FUNCTION do_stopbits
  139.     PARAMETERS portid, col
  140.     PRIVATE sbits
  141.  
  142.     DEFINE POPUP pop_stopbits FROM 01, col;
  143.         IN SCREEN;
  144.         SHADOW
  145.         DEFINE BAR 1  OF pop_stopbits PROMPT "  1  "
  146.         DEFINE BAR 2  OF pop_stopbits PROMPT "  2  "
  147.  
  148.     ON SELECTION POPUP pop_stopbits =_do_stopbits(portid, VAL(PROMPT()))
  149.     ACTIVATE POPUP pop_stopbits
  150.     RELEASE pop_stopbits
  151. RETURN (0)
  152.  
  153.  
  154.  
  155. FUNCTION _do_stopbits
  156.     PARAMETERS portid, sbits
  157.     PRIVATE ret
  158.  
  159.     ret = set_parm(portid, STOPBITS, sbits)
  160.     DEACTIVATE POPUP pop_stopbits
  161. RETURN (ret)
  162.  
  163.  
  164.  
  165. *
  166. * DO_PARITY(expN portid, expN col)
  167. * Show a menu that allows the user to set parity.
  168. * Called from data_format_menu()
  169. *
  170. FUNCTION do_parity
  171.     PARAMETERS portid, col
  172.     PRIVATE pbits
  173.  
  174.     DEFINE POPUP pop_parity FROM 01, col;
  175.         IN SCREEN;
  176.         SHADOW
  177.         DEFINE BAR 1  OF pop_parity PROMPT "NONE"
  178.         DEFINE BAR 2  OF pop_parity PROMPT "ODD"
  179.         DEFINE BAR 3  OF pop_parity PROMPT "EVEN"
  180.         DEFINE BAR 4  OF pop_parity PROMPT "MARK"
  181.         DEFINE BAR 5  OF pop_parity PROMPT "SPACE"
  182.  
  183.     ON SELECTION POPUP pop_parity =_do_parity(portid, PROMPT())
  184.     ACTIVATE POPUP pop_parity
  185.     RELEASE pop_parity
  186. RETURN (0)
  187.  
  188.  
  189.  
  190. FUNCTION _do_parity
  191.     PARAMETERS portid, nChoice
  192.     PRIVATE ret
  193.  
  194.     nChoice = ALLTRIM(nChoice)
  195.     DO CASE
  196.         CASE nChoice = 'NONE'
  197.             ret = PARITY_NONE
  198.         CASE nChoice = 'ODD'
  199.             ret = PARITY_ODD
  200.         CASE nChoice = 'EVEN'
  201.             ret = PARITY_EVEN
  202.         CASE nChoice = 'MARK'
  203.             ret = PARITY_MARK
  204.         CASE nChoice = 'SPACE'
  205.             ret = PARITY_SPACE
  206.         OTHERWISE
  207.             ret = -1
  208.     ENDCASE
  209.     IF ret >= 0
  210.         ret = set_parm(portid, PARITY, ret)
  211.         DEACTIVATE POPUP pop_parity
  212.     ENDIF
  213. RETURN (ret)
  214.  
  215.  
  216.  
  217. *
  218. * DO_SPEED(expN portid)
  219. * This menu allows the user to select the data transfer rate.
  220. *
  221. PROCEDURE do_speed
  222.     PARAMETERS portid, col
  223.     PRIVATE speed
  224.  
  225.     DEFINE POPUP pop_speed FROM 01, col;
  226.         IN SCREEN;
  227.         SHADOW
  228.         DEFINE BAR 1  OF pop_speed PROMPT "50"
  229.         DEFINE BAR 2  OF pop_speed PROMPT "75"
  230.         DEFINE BAR 3  OF pop_speed PROMPT "110"
  231.         DEFINE BAR 4  OF pop_speed PROMPT "150"
  232.         DEFINE BAR 5  OF pop_speed PROMPT "300"
  233.         DEFINE BAR 6  OF pop_speed PROMPT "600"
  234.         DEFINE BAR 7  OF pop_speed PROMPT "1200"
  235.         DEFINE BAR 8  OF pop_speed PROMPT "2400"
  236.         DEFINE BAR 9  OF pop_speed PROMPT "4800"
  237.         DEFINE BAR 10 OF pop_speed PROMPT "9600"
  238.         DEFINE BAR 11 OF pop_speed PROMPT "19200"
  239.         DEFINE BAR 12 OF pop_speed PROMPT "38400"
  240.         DEFINE BAR 13 OF pop_speed PROMPT "57600"
  241.         DEFINE BAR 14 OF pop_speed PROMPT "115200"
  242.  
  243.     ON SELECTION POPUP pop_speed =_do_speed(portid, VAL(PROMPT()))
  244.     =display_data_format(portid)
  245.     ACTIVATE POPUP pop_speed
  246.     RELEASE pop_speed
  247. RETURN (0)
  248.  
  249.  
  250.  
  251. FUNCTION _do_speed
  252.     PARAMETERS portid, speed
  253.     PRIVATE ret
  254.  
  255.     ret = set_speed(portid, speed)
  256.     =display_data_format(portid)
  257.     DEACTIVATE POPUP pop_speed
  258. RETURN (ret)
  259.  
  260.  
  261.  
  262. FUNCTION clear_status_line
  263.     PARAMETERS rstart, rend
  264.     PRIVATE row
  265.     ACTIVATE WINDOW w_status
  266.     row = WROWS() - 1
  267.     @row, rstart CLEAR TO row, rend
  268. RETURN
  269.  
  270.  
  271.  
  272. FUNCTION status_msg
  273.     PARAMETERS col, msg
  274.     =clear_status_line(col, 78)
  275.     @WROWS()-1, col SAY msg
  276. RETURN (0)
  277.  
  278.  
  279.  
  280. FUNCTION ct_quit
  281.     PARAMETERS portid
  282.  
  283.     DEACTIVATE WINDOW w_term
  284.     DEACTIVATE WINDOW w_status
  285.     CLEAR
  286.     @ SROWS()/2-1, 00 SAY PADC("End of CommTools Terminal Version " + ALLTRIM(STR(version)), WCOLS())
  287.     @ SROWS()/2, 00 SAY PADC("Thank You for Using CommTools - Fox", WCOLS())
  288.     CLOSE PROCEDURE
  289.     DEACTIVATE MENU main_menu
  290.     CLEAR ALL
  291.     EXIT
  292. RETURN (0)
  293.  
  294.  
  295.  
  296. *.............................................................................
  297. *
  298. * GET_FILNAM -- Get a file name from the user.
  299. * Parameters:
  300. *   status -- Flag indicating whether file is to be sent (.T.) or received (.F.)
  301. * Return Value:
  302. *   The file name
  303. *.............................................................................
  304. FUNCTION get_filnam
  305.     PARAMETERS status
  306.     PRIVATE scr, fnam, done, direct, i
  307.     PUBLIC getlist, def_colors
  308.  
  309.     done = .F.
  310.     direct = IIF(status,"Send:","Receive:")
  311.     SET SCOREBOARD off
  312.  
  313.     * Define Window for File Name
  314.     DEFINE WINDOW w_fname FROM 10,20 TO 16,70 TITLE 'File Select Window' ;
  315.         SHADOW
  316.     ACTIVATE WINDOW w_fname
  317.  
  318.     @ 1,1 SAY "Enter name of file to"
  319.     @ 1,23 say direct
  320.  
  321.     DO WHILE !DONE
  322.         fnam = SPACE(80)
  323.         @ 1,30 GET fnam PICTURE "@!S16"
  324.         READ
  325.  
  326.         IF LASTKEY() = ESC
  327.             fnam = ""
  328.             done = .T.
  329.         ELSE
  330.             fnam = ALLTRIM(fnam)
  331.             IF valid_nam(fnam,status)
  332.                 done = .T.
  333.             ELSE
  334.                 @ 2,2 say "Invalid/Not Found"
  335.                 @ 3,2 say "Press ESC to abort"
  336.                 i = 0
  337.                 DO WHILE i = 0
  338.                     i = inkey()
  339.                 ENDDO
  340.                 IF i = ESC
  341.                     fnam = ""
  342.                     done = .T.
  343.                 ENDIF
  344.                 @ 2,2 say "                 "
  345.                 @ 3,2 say "                  "
  346.             ENDIF
  347.         ENDIF
  348.     ENDDO
  349.     DEACTIVATE WINDOW w_fname
  350. RETURN fnam
  351.  
  352.  
  353.  
  354. *
  355. * VALID_NAM -- Determine whether a file exists or whether a string is a
  356. * valid file name.
  357. * Parameters:
  358. *   nam     -- file name;
  359. *   exist   -- flag, determine if the file exists;
  360. *
  361. * Return Value:
  362. *   .T.     --
  363. *   .F.     --
  364. *
  365. FUNCTION valid_nam
  366.     PARAMETERS nam,exist
  367.     PRIVATE e,ret,r
  368.  
  369.     ret = .F.
  370.     e = FILE(nam)
  371.     IF exist                    && must exist
  372.         IF e                    && does exist
  373.             ret = .t.
  374.         ENDIF
  375.     ELSE                        && just valid name
  376.         IF e                    && file exists and will be overwritten
  377.             ret = .t.           && may want to ask here
  378.         ELSE                    && no existing file, can we make one?
  379.             r = FCREATE(nam, 0)
  380.             IF r >= 0           && yes, valid name
  381.                 ret = .T.
  382.                 =FCLOSE(r)
  383.                 ERASE &nam
  384.             ENDIF
  385.         ENDIF
  386.     ENDIF
  387. RETURN ret
  388.  
  389.  
  390.  
  391. FUNCTION get_protocol
  392.     PARAMETERS col
  393.     PRIVATE protocol
  394.  
  395.     protocol = 0
  396.     DEFINE POPUP pop_protocol FROM 01, col;
  397.         IN SCREEN;
  398.         SHADOW
  399.         DEFINE BAR 1  OF pop_protocol PROMPT " \<ASCII      "
  400.         DEFINE BAR 2  OF pop_protocol PROMPT " \<KERMIT     "
  401.         DEFINE BAR 3  OF pop_protocol PROMPT " \<XMODEM     "
  402.         DEFINE BAR 4  OF pop_protocol PROMPT " XMODEM-\<CRC "
  403.         DEFINE BAR 5  OF pop_protocol PROMPT " XMODEM-\<1k  "
  404.         DEFINE BAR 6  OF pop_protocol PROMPT " \<YMODEM     "
  405.         DEFINE BAR 7  OF pop_protocol PROMPT " YMODEM-\<g   "
  406.         DEFINE BAR 8  OF pop_protocol PROMPT " \<ZMODEM     "
  407.     ON SELECTION POPUP pop_protocol protocol=_protocol_menu(BAR())
  408.     ACTIVATE POPUP pop_protocol
  409.     RELEASE POPUP pop_protocol
  410. RETURN (protocol)
  411.  
  412.  
  413.  
  414. FUNCTION _protocol_menu
  415.     PARAMETERS nChoice
  416.  
  417.     DO CASE
  418.         CASE nChoice = 1
  419.             protocol = ASCII
  420.         CASE nChoice = 2
  421.             protocol = KERMIT
  422.         CASE nChoice = 3
  423.             protocol = XMODEM
  424.         CASE nChoice = 4
  425.             protocol = XMODEM_CRC
  426.         CASE nChoice = 5
  427.             protocol = XMODEM_1K
  428.         CASE nChoice = 6
  429.             protocol = YMODEM
  430.         CASE nChoice = 7
  431.             protocol = YMODEM_G
  432.         CASE nChoice = 8
  433.             protocol = ZMODEM
  434.         OTHERWISE
  435.             protocol = -1
  436.     ENDCASE
  437.     =status_msg(0, "Protocol: " + ALLTRIM(PROMPT()))
  438.     DEACTIVATE POPUP pop_protocol
  439. RETURN (protocol)
  440.  
  441.  
  442.  
  443. FUNCTION xfer_progress
  444.     PARAMETERS status, parm
  445.     PRIVATE parm1, str, file_size, ro, str1
  446.     PRIVATE file_name
  447.  
  448.     ro   = xfer_row
  449.     str  = " "
  450.     str1 = " "
  451.     DO CASE
  452.         CASE status = CONNECTION_LOST
  453.             str = "Connection lost at " + ALLTRIM(STR(parm)) + " bytes"
  454.         CASE status = CT_CHECKSUM
  455.             str = "Using checksum error correction"
  456.         CASE status = CT_CRC
  457.             str = "Using CRC error correction"
  458.         CASE status = CT_CRC_ERROR
  459.             str = "CRC/checksum error"
  460.         CASE status = CT_DISK_ERROR
  461.             str = "I/O Error Writing to Disk"
  462.         CASE status = CT_DISK_FULL
  463.             str = "Disk full"
  464.         case status = CT_DOWN_RESUME_TRY
  465.             str = "Attempting download resume at " + ALLTRIM(STR(parm)) + " bytes"
  466.         CASE status = CT_EOT
  467.             str = "Final ACK received!"
  468.         CASE status = CT_FILE_DATE
  469.             @03, 13 SAY SPACE(30)
  470.             @03, 13 SAY parm
  471.             str = "File Date"
  472.         CASE status = CT_FILE_NAME
  473.             @01, 13 SAY SPACE(30)
  474.             @01, 13 SAY parm
  475.             str = "File Name"
  476.         CASE status = CT_FILE_PROTECTED
  477.             str = "Receive file name exists - renaming received file"
  478.         CASE status = CT_FILE_SIZE
  479.             IF parm != -1
  480.                 @04, 13 SAY ALLTRIM(STR(parm))
  481.             ELSE
  482.                 @04, 13 SAY "Not reported"
  483.             ENDIF
  484.             str = "File Size"
  485.         CASE status = CT_FILE_SOURCE
  486.             IF parm == 0
  487.                 str = "Sending from DISK"
  488.             ELSE
  489.                 str = "Sending from RAM"
  490.             ENDIF
  491.         CASE status = CT_FILE_XFER_ENDED
  492.             str = "End of transfer of this file"
  493.         CASE status = CT_JUNK_RECEIVED
  494.             str = "Junk Received"
  495.         CASE status = CT_MAX_ERRORS_REACHED
  496.             str = "Max. Errors Reached"
  497.         CASE status = CT_MSG
  498.             str = " "
  499.         CASE status = CT_REMOTE_CANCELLED
  500.             str = "Remote Cancelled"
  501.         CASE status = CT_RENAMED_FILE
  502.             str = "Renamed incoming file to " + ALLTRIM(parm)
  503.         CASE status = CT_RX_ACK
  504.             str1 = "ACK"
  505.         CASE status = CT_RX_CAN
  506.             str1 = "CAN"
  507.         CASE status = CT_RX_ENQ
  508.             str1 = "ENQ"
  509.         CASE status = CT_RX_NAK
  510.             str1 = "NAK"
  511.         CASE status = CT_RX_SEQ
  512.             str1 = "SEQ " + ALLTRIM(STR(parm))
  513.         CASE status = CT_SKIP_FILE
  514.             str = "Skipping file"
  515.         CASE status = CT_SOH
  516.             str = "Received Start of Header"
  517.         CASE status = CT_STX
  518.             str = "Received Start of Header"
  519.         case status = CT_SYNC_END
  520.             str = "File recovery at " + ALLTRIM(STR(parm)) + " bytes"
  521.         case status = CT_SYNC_START
  522.             str = "At " + ALLTRIM(STR(parm)) + " bytes. Calibrating..."
  523.         CASE status = CT_TIMEOUT
  524.             str = "Remote Did Not Start. Attempt " + ALLTRIM(STR(parm))
  525.         CASE status = CT_TX_ACK
  526.             str = "Sent ACK to remote"
  527.         CASE status = CT_TX_BUFFER_NOT_EMPTY
  528.             str = "Waiting for transmit buffer to empty"
  529.         CASE status = CT_TX_CAN
  530.             str = "Sent CAN to remote"
  531.         CASE status = CT_TX_ENQ
  532.             str1 = "ENQ"
  533.         CASE status = CT_TX_NAK
  534.             str = "Sent NAK to remote"
  535.         CASE status = CT_TX_SEQ
  536.             str1 = "SEQ " + ALLTRIM(STR(parm))
  537.             str1 = "ENQ"
  538.         CASE status = CT_UNSPECIFIED
  539.             str = "Unspecified Error"
  540.         CASE status = CT_XMODEM
  541.             str = "Using XMODEM"
  542.         CASE status = CT_XMODEM1K
  543.             str = "Using XMODEM-1K"
  544.         CASE status = CT_XMODEMCRC
  545.             str = "Using XMODEM-CRC"
  546.         CASE status = CT_YMODEM
  547.             str = "Using YMODEM protocol"
  548.         CASE status = CT_YMODEMG
  549.             str = "Using YMODEM-g protocol"
  550.         CASE status = CT_XFER_POSITION
  551.             str = ALLTRIM(STR(parm))
  552.             IF ro != 0
  553.                 ro = 2
  554.             ENDIF
  555.             * Crude method of calculating file transfer efficiency
  556.             * Do not use this as an alternative to your grandmother's
  557.             * atomic clock.
  558.             PUBLIC start_time, xfer_speed, start_pos
  559.             PRIVATE efficiency
  560.  
  561.             IF parm == 0
  562.                 @ro+4, 01 SAY "Efficiency: "
  563.                 @ro+4, 19 SAY "(not calculated by atomic clock)"
  564.                 start_time = SECONDS()
  565.                 xfer_speed = get_carrier_speed(portid)/10
  566.                 start_pos  = parm
  567.             ELSE
  568.                 IF xfer_row != 0 .AND. parm > 1023
  569.                     efficiency = (parm - start_pos)/(xfer_speed * (SECONDS() - start_time))
  570.                     IF efficiency > 1
  571.                         efficiency = 1
  572.                     ENDIF
  573.                     @ro+4, 13 SAY ALLTRIM(STR(efficiency*100)) + "%  "
  574.                 ENDIF
  575.             ENDIF
  576.  
  577.         CASE status = USER_CANCELLED
  578.             str = "Keyboard cancel received"
  579.  
  580.         * Kermit-specific messages
  581.         CASE status = K_ABORT
  582.             str = "Abort Packet"
  583.         CASE status = K_BREAK
  584.             str = "Break Packet"
  585.         CASE status = K_DATA
  586.             str = "Data Packet"
  587.         CASE status = K_EOF
  588.             str = "End-of-File Packet"
  589.         CASE status = K_ERROR
  590.             str = "Error Packet"
  591.         CASE status = K_FHEAD
  592.             str = "File Header Packet"
  593.         CASE status = K_SINIT
  594.             str = "Send-Init Packet"
  595.  
  596.         * ZMODEM-specific messages
  597.         CASE status = ZABORT
  598.             str1 = "ZABORT"
  599.         CASE status = ZACK
  600.             str1 = "ZACK"
  601.         CASE status = ZCAN
  602.             str1 = "ZCAN"
  603.         CASE status = ZCRC
  604.             str1 = "ZCRC"
  605.         CASE status = ZCHALLENGE
  606.             str = "Remote sent ZCHALLENGE " + ALLTRIM(STR(parm))
  607.             str1 = "ZCHALLENGE"
  608.         CASE status = ZCOMMAND
  609.             str = "Remote sent command " + ALLTRIM(parm)
  610.             str1 = "ZCOMMAND"
  611.         CASE status = ZCOMPL
  612.             str1 = "ZCOMPL"
  613.         CASE status = ZDATA
  614.             str1 = "ZDATA"
  615.         CASE status = ZEOF
  616.             str1 = "ZEOF"
  617.         CASE status = ZFERR
  618.             str1 = "ZFERR"
  619.         CASE status = ZFILE
  620.             str1 = "ZFILE"
  621.         CASE status = ZFIN
  622.             str1 = "ZFIN"
  623.         CASE status = ZFREECNT
  624.             str = "Free space is " + ALLTRIM(STR(parm))
  625.             str1 = "ZFREECNT"
  626.         CASE status = ZNAK
  627.             str1 = "ZNAK"
  628.         CASE status = ZRINIT
  629.             str1 = "ZRINIT"
  630.         CASE status = ZRPOS
  631.             str1 = "ZRPOS"
  632.         CASE status = ZRQINIT
  633.             str1 = "ZRQINIT"
  634.         CASE status = ZSINIT
  635.             str = "Receiver's ATTN sequence is '" + ALLTRIM(parm) + "'"
  636.             str1 = "ZSINIT"
  637.         CASE status = ZSKIP
  638.             str1 = "ZSKIP"
  639.         CASE status = ZSTDERR
  640.             str1 = "ZSTDERR"
  641.         OTHERWISE
  642.             str  = " "
  643.             str1 = " "
  644.     ENDCASE
  645.     IF xfer_row != 0
  646.         IF str != " "
  647.             @ro, 13 SAY SPACE(36)
  648.             @ro, 13 SAY str
  649.         ENDIF
  650.         IF str1 != " "
  651.             @ro+2, 42 SAY SPACE(9)
  652.             @ro+2, 42 SAY str1
  653.         ENDIF
  654.     ELSE
  655.         =status_msg(0, str)
  656.     ENDIF
  657. RETURN (NIL)
  658.  
  659.  
  660.  
  661. FUNCTION display_xfer
  662.     PARAMETERS row, col, fname, fsize
  663.     PUBLIC xfer_row
  664.  
  665.     DEFINE WINDOW w_xfer FROM row,col TO row+10,col+52;
  666.         TITLE 'File Transfer Progress';
  667.         SHADOW
  668.     ACTIVATE WINDOW w_xfer
  669.     @01, 01 SAY "File Name : "
  670.     @02, 01 SAY "Bytes     : "
  671.     @03, 01 SAY "Date      : "
  672.     @04, 01 SAY "File Size : "
  673.     @05, 01 SAY "Last Msg. : "
  674.     xfer_row = 5
  675.     IF fname != "$"
  676.         @01, 13 SAY fname
  677.     ENDIF
  678.     IF fsize != NULL
  679.         @04, 13 SAY fsize
  680.     ENDIF
  681. RETURN (0)
  682.