home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / p / prcm_ext.zip / EXTPRO.WAS next >
Text File  |  1993-01-05  |  7KB  |  143 lines

  1. ;****************************************************************************
  2. ;*       This aspect file is the result of wanting to be able to run DSZ    *
  3. ;*  external zmodem protocol from ProComm Plus for Windows.  The follow-    *
  4. ;*  ing is an amateur's attempt at creating a workable, user-friendly,      *
  5. ;*  professional looking interface between ProWin and DSZ (both very good   *
  6. ;*  programs that work well together).  The text you are about to view is   *
  7. ;*  my actual working copy of "EXTernal PROtocol" and is geared specific-   *
  8. ;*  ally towards running DSZ on my computer.  Hopefully I will include      *
  9. ;*  enough comments to help anyone convert to their own system should they  *
  10. ;*  so desire.  I ask nothing of or for this script file.  It is rough and  *
  11. ;*  not completely tested.  I hope, however, it will help or inspire some-  *
  12. ;*  one else to create as I have been helped and inspired by things I have  *
  13. ;*  downloaded.  Much of the procedure REST_SCRIPT came from a download I   *
  14. ;*  got from the DataStorm forum on CompuServe.  Thanks to he who provided  *
  15. ;*  it.  I also wish to acknowledge the people of the DataStorm forum       *
  16. ;*  (both sysops and users) for their help and inspiration.  I would like   *
  17. ;*  to especially thank Paul Heim and my father for their continuing help   *
  18. ;*  and advice.  Now about the program.                                     *
  19. ;*       This script gives the user a dialog box with a directory listing,  *
  20. ;*  an edit box to enter the name of a file to upload, and the choice of    *
  21. ;*  uploading or downloading with three of my favorite protocols:  DSZ      *
  22. ;*  Zmodem and Ymodem as well as HS/Link, a quick bi-directional protocol.  *
  23. ;*  The selection of the protocols is done with radio buttons.  The script  *
  24. ;*  accesses .bat files which I wrote to use with ProComm Plus 2.01 (DOS).  *
  25. ;*  The user will have to create his/her own .bat files to work on their    *
  26. ;*  system.                                                                 *
  27. ;****************************************************************************
  28.  
  29.  
  30. #DEFINE NOMODEM "USR 9600PC-AUTO-NONE"     ;Defines a non-modem connection.
  31.  
  32. STRING FILELST = "C:\COMM\UL\*.*"      ;My upload directory.
  33.  
  34. STRING LISTFILE;                           ;Files user lists for upload.
  35.  
  36. STRING ADDED                               ;Will be defined as .bat file to
  37.                                             call.
  38.  
  39. STRING VAR4                                ;Unused variable (but necessary).
  40.  
  41. STRING CON                                 ;Will hold current connection.
  42.  
  43. INTEGER DSZPROTO, STATUS                   ;Two integer values defined later
  44.                                             in the script.
  45.  
  46. PROC MAIN                                  ;Main procedure.
  47.  
  48.    CALL UP_BOX                             ;Calls procedure to make a dialog
  49.                                             box.
  50.  
  51.    WHEN DIALOG CALL CHK_BOX                ;Checks for activity in the dial-
  52.                                             og box and defines it with a
  53.                                             procedure.
  54.  
  55.    WHILE STATUS != 1                       ;Creates endless loop unless user
  56.    ENDWHILE                                 hits cancel pushbutton.
  57.  
  58. ENDPROC                                    ;Ends the main procedure.
  59.  
  60. PROC UP_BOX                                ;This procedure creates the dia-
  61.                                             log box. The value for which
  62.                                             radio button is selected is
  63.                                             carried in DSZPROTO.
  64.    dialogbox 52 33 252 205 3 "External  Protocol  Options"
  65.      text  8 7 84 17 left "Files available for upload from the directory:"
  66.      text  106 7 99 19 left "List file(s) for upload with a space between each if batch."
  67.      pushbutton 28 158 40 14 "OK" normal
  68.      pushbutton 28 184 40 14 "Cancel" cancel
  69.      radiobutton 108 95 85 9 "Zmodem Moby (batch)" dszproto
  70.      radiobutton 108 106 74 10 "Ymodem-G (batch)"
  71.      radiobutton 108 118 62 9 "HSLink (batch)"
  72.      radiobutton 108 152 126 10 "Zmodem (batch w/ crash recovery)"
  73.      radiobutton 108 165 65 10 "Ymodem (batch)"
  74.      radiobutton 108 177 62 9 "HSLink (batch)" endgroup
  75.      dirlistbox 12 36 70 105 filelst single var4
  76.      dirpath 8 25 71 8
  77.      editbox 101 36 121 40 listfile
  78.      groupbox 101 81 100 52 "Upload Protocols"
  79.      groupbox 101 140 140 53 "Download Protocols"
  80.    enddialog
  81. ENDPROC
  82.  
  83. PROC CHK_BOX                                ;This procedure checks to see
  84.                                              what kind of dialog event has
  85.                                              taken place.
  86.  
  87.    STATUS = $DIALOG                         ;Status takes integer value of
  88.                                              $DIALOG through rest of script.
  89.  
  90.    IF STATUS != 10                          ;If OK button selected, continue
  91.      RETURN                                  with REST of SCRIPT. Otherwise
  92.    ENDIF                                     RETURN to WHEN statement in
  93.    CALL REST_SCRIPT                          main procedure.
  94. ENDPROC
  95.  
  96. PROC REST_SCRIPT                            ;Rest of script.
  97.  
  98. INTEGER TXFER                               ;Integer value of running DOS
  99.                                              application.
  100.  
  101.    SWITCH DSZPROTO                          ;Depending on integer value of
  102.      CASE 1                                  DSZPROTO (decided by which
  103.        ADDED = "ZM0D-U.BAT "                 radio button was selected),
  104.      ENDCASE                                 ADDED will take on value of
  105.      CASE 2                                  filespec to call.  Notice space
  106.        ADDED = "GM0D-U.BAT "                 after .bat file names: very
  107.      ENDCASE                                 important (",,,.BAT ").
  108.      CASE 3
  109.        ADDED = "HS-U.BAT "
  110.      ENDCASE
  111.      CASE 4
  112.        ADDED = "ZM0D-D.BAT "
  113.      ENDCASE
  114.      CASE 5
  115.        ADDED = "GM0D-D.BAT "
  116.      ENDCASE
  117.      CASE 6
  118.        ADDED = "HS-D.BAT "
  119.      ENDCASE
  120.    ENDSWITCH
  121.  
  122.    FETCH CONNECTION TYPE CON               ;Get current connection values to
  123.                                             store for later.
  124.  
  125.    SET CONNECTION TYPE NOMODEM             ;Disables ProWin's control over
  126.                                             COM port. You will need to
  127.                                             select your modem's NONE from
  128.                                             Setup (Connection).
  129.  
  130.    STRCAT ADDED LISTFILE                   ;Marries the values of .bat file
  131.                                             and files listed for upload.
  132.  
  133.    DOS ADDED TXFER                         ;Shells to DOS and runs DSZ.
  134.  
  135.    WHILE ISTASK TXFER                      ;Endless loop until application
  136.    ENDWHILE                                 is done.
  137.  
  138.    SET CONNECTION TYPE CON                 ;Resets connection to former
  139.                                             values.
  140.  
  141.    EXIT                                    ;Ends script file.
  142. ENDPROC
  143.