home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / EASL2PRF.ZIP / PROFSEND.INC < prev    next >
Text File  |  1990-07-18  |  30KB  |  768 lines

  1. #
  2. #                           Generated by Layout/CUA
  3. # (Layout/CUA COPYRIGHT (C) INTERACTIVE IMAGES, INC. 1989. ALL RIGHTS 
  4. #  RESERVED)
  5. #            Code generated on TUESDAY JANUARY 23, 1990 at TIME 15:44:47
  6. #
  7. boolean variable DidOKCUA Last_Dir
  8. boolean BuiltDirListDB is false
  9. string FileNameX FileName FileExt DirName DirExt TestName CD_DirName DirLast
  10. string CurrDirList Temp1 is "" T_Char TempX
  11. string ChosenPCFileName Is_colon Disk_ID
  12. string ChosenPCFileNameX
  13. string HostFileName SendCommand HostOptions
  14. string PCFileName1 PCFileNameExt LogTermID TermFirst2 LoggedViaMe is "N"
  15. string Parms ChangeToDisk Slash CurrDirListX AscOrBin DocMsg PROFSDocNum
  16. string MailUserName[10] Cron1 Cron2 FTErrorMsg RetCode MsgText
  17. integer PCListName Last_Char is 1
  18. integer X_Ctr LastSlash
  19. integer NumDisks BytesTransmitted
  20.  
  21. #
  22. # Dialog Box Object Definition(s)
  23. #
  24.  
  25. include putinpr.inc
  26. include mailscr.inc
  27. include hostfdb.inc
  28. include chprofs.inc
  29. include fromprof.inc
  30. include msgdb.inc
  31.  
  32. enabled invisible modal dialog box UserIDDB
  33.     size 200 98
  34.     at position 94 45
  35.     dialog border
  36.     title bar "User Information"
  37.     system menu
  38.  
  39. enabled visible static text UserIDST
  40.     size 36 8
  41.     at position 24 63
  42.     in UserIDDB
  43.     right align
  44.     top align
  45.     text "User ID:"
  46.  
  47. enabled visible entry field UserIDEF
  48.     size 70 12
  49.     at position 64 63
  50.     in UserIDDB
  51.     text size 8 columns
  52.     left align
  53.  
  54. enabled visible static text PassWordST
  55.     size 48 8
  56.     at position 16 47
  57.     in UserIDDB
  58.     right align
  59.     top align
  60.     text "Password:"
  61.  
  62. disabled visible entry field PassWordHiddenEF
  63.     size 68 12
  64.     at position 66 47
  65.     in UserIDDB
  66.     text size 30 columns
  67.     left align
  68.  
  69. enabled visible entry field PassWordEF
  70.     size 2 12
  71.     at position 66 47
  72.     in UserIDDB
  73.     text size 8 columns
  74.     left align
  75.  
  76. enabled visible default push button OK
  77.     size 38 12
  78.     at position 6 4
  79.     in UserIDDB
  80.     group is Actions
  81.     text "~OK"
  82.  
  83. enabled visible cancel push button Cancel
  84.     size 38 12
  85.     at position 56 4
  86.     in UserIDDB
  87.     group is Actions
  88.     text "Cancel"
  89.  
  90. enabled invisible modal dialog box ChooseFileDB
  91.     size 268 140
  92.     at position 48 31
  93.     dialog border
  94.     title bar "Choose A File"
  95.     system menu
  96.  
  97. enabled visible static text DiskDriveST
  98.     size 26 8
  99.     at position 10 88
  100.     in ChooseFileDB
  101.     left align
  102.     top align
  103.     word wrap
  104.     text "Drive"
  105.  
  106. enabled visible static text CurrDirST
  107.     size 180 8
  108.     at position 85 118
  109.     in ChooseFileDB
  110.     left align
  111.     top align
  112.     word wrap
  113.  
  114. enabled visible static text Curr_DirST
  115.     size 79 8
  116.     at position 6 118
  117.     in ChooseFileDB
  118.     left align
  119.     top align
  120.     word wrap
  121.     text "Current Directory: "
  122.  
  123. enabled visible static text Curr_Dir_ST_EF
  124.     size 79 8
  125.     at position 6 105
  126.     in ChooseFileDB
  127.     left align
  128.     top align
  129.     word wrap
  130.     text "Select Directory: "
  131.  
  132. enabled visible entry field Curr_Dir_EF
  133.     size 140 12
  134.     at position 86 105
  135.     in ChooseFileDB
  136.     left align
  137.     text size 40 columns
  138.     text ""
  139.  
  140. enabled visible static text DirectoryST
  141.     size 48 8
  142.     at position 60 89
  143.     in ChooseFileDB
  144.     left align
  145.     top align
  146.     text "Directory"
  147.  
  148. enabled visible static text PCFileNameST
  149.     size 48 8
  150.     at position 140 88
  151.     in ChooseFileDB
  152.     left align
  153.     top align
  154.     word wrap
  155.     text "PC File Name"
  156.  
  157. enabled visible list box DiskDriveLB
  158.     size 40 49
  159.     at position 10 35
  160.     in ChooseFileDB
  161.     parameter is "disk$d.prn"
  162.  
  163. enabled visible list box DirListLB
  164.     size 72 56
  165.     at position 60 28
  166.     in ChooseFileDB
  167.     parameter is "dir$list.prn"
  168.     sort ascending
  169.  
  170. enabled visible list box PCFileLF
  171.     size 130 56
  172.     at position 136 28
  173.     in ChooseFileDB
  174.     parameter is "pc$list.prn"
  175.     sort ascending
  176.  
  177. enabled visible default push button OK
  178.     size 38 12
  179.     at position 6 4
  180.     in ChooseFileDB
  181.     group is Actions
  182.     text "~OK"
  183.  
  184. enabled visible cancel push button Cancel
  185.     size 38 12
  186.     at position 56 4
  187.     in ChooseFileDB
  188.     group is Actions
  189.     text "Cancel"
  190.  
  191. enabled invisible modal dialog box BytesSentDB
  192.     size 200 60
  193.     at position 48 60
  194.     dialog border
  195.     title bar "File Transfer Messages"
  196.  
  197. enabled visible static text BytesSentST
  198.     size 150 40
  199.     at position 10 5
  200.     in BytesSentDB
  201.     left align
  202.     top align
  203.     word wrap
  204.  
  205. enabled invisible modal dialog box InitializeDB
  206.     size 200 60
  207.     at position 48 60
  208.     dialog border
  209.  
  210. enabled visible static text InitializeST
  211.     size 150 40
  212.     at position 10 5
  213.     in InitializeDB
  214.     left align
  215.     top align
  216.     word wrap
  217. #
  218. # Subroutine Definition(s)
  219. #
  220.  
  221. subroutine PutINPROFS(string:HostFileName) is 
  222.     copy "Putting File in PROFS \n█" to DocMsg
  223.     change BytesSentST text to DocMsg
  224.     make BytesSentDB visible
  225.     action Init3270                       # issue the store in PROFS Command
  226.     copy "EPQPCPRF " HostFileName " A " AscOrBin to Keystrokes
  227.     action EnterString
  228.     action DefineWatch                    # wait for response from EPQPCPRF
  229.       copy 1 to WatchRow
  230.       copy 1 to WatchCol
  231.       copy "EPQFROM" to WatchChar
  232.       action WatchForChar
  233.     action WatchAndWait
  234.     if (WatchGaveUp) then
  235.       # error
  236.                      copy "An error occurred while storing the document in PROFS.\n\n" to MsgText     
  237.                      append "Switch to PROFS and get to the main menu." to MsgText
  238.                      append "When you get to the PROFS Main Menu, press O.K and then try again." to MsgText
  239.                      call ProcessMsgDB (MsgText)
  240.                     copy false to DidOKCUA
  241.     else
  242.        append "█" to DocMsg
  243.        change BytesSentST text to DocMsg
  244.        make BytesSentDB visible
  245.        copy (text of FromEF) to Keystrokes    # pass the store parameters to
  246.        action EnterString                     # the PROFS screen
  247.        copy (text of ToEF) to Keystrokes
  248.        action EnterString
  249.        copy (text of SubjectEF) to Keystrokes
  250.        action EnterString
  251.        copy "DB FILE - " HostFileName " A" to Keystrokes
  252.        action EnterString
  253.        action DefineWatch              # look for EPQPCPRF panel 
  254.           copy "EPQPCPRF" to WatchChar # which tells us the result of
  255.           copy 2 to WatchCol           # the document storage function.
  256.           copy 1 to WatchRow           # the panel will display the return
  257.           copy 100 to SettleTime       # code and document number
  258.       copy 6000 to GiveUpTime
  259.           action WatchForChar
  260.           action WatchForNoX
  261.        action WatchAndWait
  262.        if (WatchGaveUp) then
  263.           # error
  264.                      copy "An error occurred while storing the document in PROFS.\n\n" to MsgText     
  265.                      append "Switch to PROFS and get to the main menu." to MsgText
  266.                      append "When you get to the PROFS Main Menu, press O.K and then try again." to MsgText
  267.                      call ProcessMsgDB (MsgText)
  268.                     copy false to DidOKCUA
  269.        else
  270.           append "█" to DocMsg
  271.           change BytesSentST text to DocMsg
  272.           make BytesSentDB visible
  273.           action ScanScreen
  274.           copy 29 to FieldNumber      # get Document Number assigned
  275.           action ReadField 
  276.           copy "Store in PROFS Complete.\n" to DocMsg
  277.           append "Doc Number: " FieldText to DocMsg
  278.           copy FieldText to PROFSDocNum
  279.           copy "EPQGO" to Keystrokes   # tell EPQPCPRF goodbye
  280.           action EnterString
  281.           make BytesSentDB invisible
  282.        end if
  283.     end if
  284.     action Stop3270                       # Stop the 3270 stuff
  285.  
  286. subroutine MailPROFS(string:PROFSDocNum) is 
  287.     copy false to DidOKCUA
  288.     call ProcessPROFSMailDocDB(DidOKCUA)
  289.     extract from PROFSDocNum    # break down Doc num into two parts for mailing
  290.         take 8 Cron1
  291.         take 4 Cron2 
  292.     if (DidOKCUA) then          # build PROFS mail document command
  293.          action Init3270        # build command
  294.          copy "PROFS MAIL NOTICE " Cron1 " " Cron2 " TO " to Keystrokes
  295.              append " " text of UserName1EF to Keystrokes   # pick up all the
  296.              append " " text of UserName2EF to Keystrokes   # user ids entered
  297.              append " " text of UserName3EF to Keystrokes
  298.              append " " text of UserName4EF to Keystrokes
  299.              append " " text of UserName5EF to Keystrokes
  300.              append " " text of UserName6EF to Keystrokes
  301.          action EnterString
  302.         action Stop3270
  303.     end if
  304.  
  305. subroutine MailNonPROFS(string:HostFileName) is    # Uses SENDFILE to mail
  306.     string NewHostFileName                         # mail the file
  307.     action Init3270        # build sendfile command
  308.     copy false to DidOKCUA                         # and then erases the
  309.     call ProcessPROFSMailDocDB(DidOKCUA)           # file from the A disk
  310.     copy HostFileName to NewHostFileName
  311.     append " A " to NewHostFileName
  312.     if (DidOKCUA) then
  313.          copy "SENDFILE " NewHostFileName " TO " to Keystrokes
  314.              append " " text of UserName1EF to Keystrokes  # pick up all the
  315.              append " " text of UserName2EF to Keystrokes  # user ids entered
  316.              append " " text of UserName3EF to Keystrokes
  317.              append " " text of UserName4EF to Keystrokes
  318.              append " " text of UserName5EF to Keystrokes
  319.              append " " text of UserName6EF to Keystrokes
  320.          action EnterString
  321.     end if
  322.        action DefineWatch             # wait for main menu to reappear
  323.           copy 100 to SettleTime
  324.           action WatchForNoX
  325.        action WatchAndWait
  326.        if (WatchGaveUp) then
  327.           # error
  328.            copy "An error occurred while storing the document in PROFS.\n\n" to MsgText     
  329.            append "Switch to the emulator and correct the problem.  \n" to MsgText
  330.            append "When corrected, press O.K and then try again." to MsgText
  331.            call ProcessMsgDB (MsgText)
  332.            copy false to DidOKCUA
  333.        else                           # erase the host file
  334.           copy "ERASE " NewHostFileName to Keystrokes
  335.           action EnterString
  336.        end if
  337.     action Stop3270
  338.  
  339. subroutine Change_ChooseFileDB(string:DirListX) is
  340.   string DirList                       # This redisplays the Directory
  341.     set pointer to SPTR_WAIT
  342.     make DirListLB invisible           # and PC file list boxes after
  343.     make PCFileLF invisible            # filling them in from the local
  344.     clear DirListLB                    # command processor
  345.     clear PCFileLF
  346.     change (Curr_Dir_EF in ChooseFileDB) text  to ""
  347.     add to DirListLB 
  348.         insert ".. [PARENT]"
  349.     extract from DirListX     # strip off blanks at end of name
  350.         take word DirList
  351.     if (DirList = ".. [PARENT]") then
  352.         copy ".." to DirList
  353.     end if
  354.     send "CD " DirList "\n" to DIRLIST
  355.     send "MPGDISK \n" to DIRLIST
  356.         begin guarded                  # current Directory
  357.                 response to line "ALL DONE" from DIRLIST    # end of the 
  358.                      leave block                           # command.
  359.                 response to line "IBM Operating" from DIRLIST # ignore this
  360.                      set pointer to SPTR_WAIT
  361.                      # do nothing
  362.                 response to line "DIRECTORY=" from DIRLIST # add directories to lb
  363.                      set pointer to SPTR_WAIT
  364.                      extract from input
  365.                         skip "="
  366.                         take word DirName
  367.                         add to DirListLB 
  368.                             insert DirName
  369.                 response to line "Path is " from DIRLIST # add directories to lb
  370.                      set pointer to SPTR_WAIT
  371.                      extract from input
  372.                         skip "is "
  373.                         take word CurrDirList
  374.                      change CurrDirST text to CurrDirList    # new dir name
  375.                 response to line "FILENAME=" from DIRLIST    # here is a line from the
  376.                      set pointer to SPTR_WAIT
  377.                      extract from input                      # listing
  378.                         skip "="
  379.                         take word FileName
  380.                      add to PCFileLF                 # must have a valid
  381.                         insert FileName   # PC file Name
  382.         end
  383.     make DirListLB visible         # display the directory listing
  384.     make PCFileLF visible          # display the PC file names listing
  385.     set pointer to SPTR_ARROW
  386.  
  387.  
  388. subroutine SetupChooseFileDB( integer : PCListName ) is
  389.     start local DIRLIST "cmd.exe"      # set up the DB the first time
  390.     change text of Curr_Dir_EF in ChooseFileDB to ""
  391.     
  392.     copy " " to CD_DirName
  393.     call Change_ChooseFileDB(CD_DirName)            # display the list of files
  394.     select line 1 in PCFileLF in ChooseFileDB  # hilite pc file name  
  395.     copy true to BuiltDirListDB
  396.  
  397. subroutine ProcessChooseFileDB( boolean : DidOKCUA ) is
  398.     begin guarded                     # DB is displayed and user is making
  399.         response to start             # selections
  400.             make ChooseFileDB visible
  401.         response to DiskDriveLB         # User clicked on Disk Drive LB
  402.             if (eventnumber = 17) then       # only respond to Second Click
  403.                copy textual line (selected line from DiskDriveLB) from DiskDriveLB to ChangeToDisk
  404.                send ChangeToDisk "\n" to DIRLIST
  405.                copy 1 to PCListName
  406.                copy " " to CD_DirName
  407.               change (Curr_Dir_EF in ChooseFileDB) text  to ""
  408.                call Change_ChooseFileDB(CD_DirName)            # display the list of files
  409.            end if
  410.         response to DirListLB                 # User clicked on Dir List LB
  411.             if (eventnumber = 17) then       # only respond to Second Click
  412.               set pointer to SPTR_WAIT
  413.                copy textual line (selected line from DirListLB) from DirListLB to CD_DirName
  414.               change (Curr_Dir_EF in ChooseFileDB) text  to ""
  415.                call Change_ChooseFileDB(CD_DirName)
  416.             end if
  417.         response to PCFileLF                 # User clicked on PC file LB
  418.             if (eventnumber = 17) then       # only respond to Second Click
  419.                 copy true to DidOKCUA
  420.                 change (Curr_Dir_EF in ChooseFileDB) text  to ""
  421.                 make ChooseFileDB invisible
  422.                 leave block
  423.             end if
  424.  
  425.         response to OK in ChooseFileDB
  426.            if (length of (text of Curr_Dir_EF in ChooseFileDB) = 0) then
  427.             copy true to DidOKCUA
  428.             make ChooseFileDB invisible
  429.             leave block
  430.           else
  431.         extract from text of Curr_Dir_EF in ChooseFileDB
  432.         take 2 Disk_ID
  433.         take word CD_DirName
  434.         extract from Disk_ID
  435.         skip 1
  436.         take 1 Is_colon
  437.        if (Is_colon = ":") then
  438.                    send Disk_ID "\n" to DIRLIST
  439.                    copy 1 to PCListName
  440.                   call Change_ChooseFileDB(CD_DirName)            # display the list of files
  441.                else
  442.                   set pointer to SPTR_WAIT
  443.                   copy text of Curr_Dir_EF in ChooseFileDB to CD_DirName
  444.                  call Change_ChooseFileDB(CD_DirName)
  445.       end if
  446.               change (Curr_Dir_EF in ChooseFileDB) text  to ""
  447.        end if
  448.  
  449.         response to Cancel in ChooseFileDB
  450.             copy false to DidOKCUA
  451.             make ChooseFileDB invisible
  452.             leave block
  453.     end
  454.  
  455. subroutine QueryChooseFileDB( integer : PCListName ) is
  456.     copy ( selected line from PCFileLF in ChooseFileDB ) to PCListName
  457.  
  458. subroutine SetupTransferFileDB( integer : PCListName ) is
  459.     copy CurrDirList to ChosenPCFileName    # set up DB and display defaults
  460.     extract from CurrDirList
  461.        skip to last
  462.        take -1 TempX
  463.     if (TempX = "\\") then
  464.       append textual line PCListName from PCFileLF to ChosenPCFileName
  465.     else
  466.       append "\\" to ChosenPCFileName         # get PC file name user clicked on
  467.       append textual line PCListName from PCFileLF to ChosenPCFileName
  468.     end if
  469.     copy textual line PCListName from PCFileLF to ChosenPCFileNameX
  470.     change ChosenFileST text to ChosenPCFileName
  471.     extract from ChosenPCFileNameX          # break up PC file name
  472.                 take to "." PCFileName1
  473.                 skip "."
  474.                 take to last PCFileNameExt
  475.     if (PCFileNameExt= "RFT") then 
  476.        uncheck ChangeFormat                 # default check box selection
  477.     else 
  478.        check ChangeFormat
  479.     end if
  480.  
  481. subroutine ProcessTransferFileDB( boolean : DidOKCUA ) is
  482.     begin guarded                              # user is in DB
  483.         response to start
  484.             make TransferFileDB visible
  485.         response to PutInPROFS in TransferFileDB   # Clicked on Put In PROFS
  486.             if (PutInPROFS is checked) then    # since file is going into
  487.                  make FromST visible           # PROFS Storage, show user
  488.                  make ToST visible             # the mail log info and let
  489.                  make SubjectST visible        # them fill it in
  490.                  make FromEF visible
  491.                  make ToEF visible
  492.                  make SubjectEF visible
  493.                  enable FromEF
  494.                  enable ToEF
  495.                  enable SubjectEF
  496.             else
  497.                  make FromST invisible         # if not putting file in PROFS
  498.                  make ToST invisible           # then we don't need the mail
  499.                  make SubjectST invisible      # log stuff, so hide it
  500.                  make FromEF invisible
  501.                  make ToEF invisible
  502.                  make SubjectEF invisible
  503.                  disable FromEF
  504.                  disable ToEF
  505.                  disable SubjectEF
  506.             end if
  507.         response to OK in TransferFileDB
  508.             copy true to DidOKCUA
  509.             make TransferFileDB invisible
  510.             leave block
  511.         response to Cancel in TransferFileDB
  512.             copy false to DidOKCUA
  513.             make TransferFileDB invisible
  514.             leave block
  515.     end
  516.  
  517. subroutine SetupUserIDDB( string : UserID, string : PassWordHidden,
  518.     string : PassWord ) is                            # show logon DB
  519.     change UserIDEF in UserIDDB text to UserID
  520.     change PassWordHiddenEF in UserIDDB text to PassWordHidden
  521.     change PassWordEF in UserIDDB text to PassWord
  522.  
  523. subroutine ProcessUserIDDB( boolean : DidOKCUA ) is
  524.     begin guarded
  525.         response to start
  526.             make UserIDDB visible
  527.         response to OK in UserIDDB
  528.             copy true to DidOKCUA
  529.             make UserIDDB invisible
  530.             leave block
  531.         response to Cancel in UserIDDB
  532.             copy false to DidOKCUA
  533.             make UserIDDB invisible
  534.             leave block
  535.         response to PassWordEF
  536.             action HidePW
  537.     end
  538.  
  539. subroutine QueryUserIDDB( string : UserID, string : PassWordHidden,
  540.     string : PassWord ) is
  541.     copy text of UserIDEF in UserIDDB to UserID
  542.     copy text of PassWordHiddenEF in UserIDDB to PassWordHidden
  543.     copy text of PassWordEF in UserIDDB to PassWord
  544.  
  545. subroutine CheckPROFStoProceed ( boolean: DidOKCUA) is
  546.          set pointer to SPTR_WAIT
  547.         action Init3270    
  548.         action DefineWatch                     
  549.            copy 1 to WatchRow
  550.           copy 2 to WatchCol
  551.           copy 100 to GiveUpTime
  552.           copy "EPQP00" to WatchChar
  553.           action WatchForChar
  554.        action WatchAndWait
  555.        if (WatchGaveUp) then
  556.           # error
  557.             copy 3000 to GiveUpTime
  558.             copy "You are not on the PROFS Main Menu\n" to MsgText
  559.             append "Switch to PROFS, get to the main menu and try again" to MsgText
  560.             call ProcessMsgDB (MsgText)
  561.             copy false to DidOKCUA
  562.            set pointer to SPTR_ARROW
  563.       else           # o.k., we are sure we are on the main menu, so proceed.
  564.                          # but we need to make sure we have logged on to PROFS Correctly
  565.           if (LoggedViaMe != "Y") then         # we did not log on via easel, so check to see if we got on via TPX
  566.                copy 3000 to GiveUpTime
  567.                copy "WHOAMI" to Keystrokes
  568.                action EnterString                   
  569.                action DefineWatch                     
  570.                     copy 24 to WatchRow
  571.                    copy 61 to WatchCol
  572.                    copy "MORE..." to WatchChar
  573.                   action WatchForChar
  574.                action WatchAndWait
  575.                 if (WatchGaveUp) then
  576.                      # error
  577.                      copy "An error occurred while checking PROFS.\n\n" to MsgText     
  578.                      append "Switch to PROFS and get to the main menu." to MsgText
  579.                      append "When you get to the PROFS Main Menu, press O.K and then try again." to MsgText
  580.                      call ProcessMsgDB (MsgText)
  581.                     copy false to DidOKCUA
  582.                 else 
  583.                       copy 1 to Row
  584.                       action ReadLine
  585.                       extract from LineText
  586.                                skip "-"
  587.                                 take word LogTermID
  588.                        extract from LogTermID
  589.                                 take 2 TermFirst2
  590.                         copy CLEAR to KeyCode
  591.                         action PressKey
  592.                         if (TermFirst2 != "TP") then   # we are not on TPX so tell the user and exit
  593.                             copy "You did not log on to PROFS via TPX or this program..\n\n" to MsgText     
  594.                            append "Switch to the emulator, log on to TPX and then logon to PROFS.  \n" to MsgText
  595.                            append "When you get to the PROFS Main Menu, press O.K and then try again." to MsgText
  596.                            call ProcessMsgDB (MsgText)
  597.                            copy false to DidOKCUA
  598.                             set pointer to SPTR_ARROW
  599.                         else         # we are logged onto TPX, so proceed
  600.                              copy true to DidOKCUA
  601.                         end if
  602.                   end if
  603.          else
  604.                copy true to DidOKCUA    
  605.          end if
  606.       end if
  607.   action Stop3270    
  608.  
  609. #
  610. # Action Subroutines
  611. #
  612.                                               # This routine transfers the file 
  613. action TransferFile is                        # & calls other routines to put in PROFS
  614.     # first make sure we are on the PROFS Main Menu - look for EPQP00
  615.     copy false to DidOKCUA
  616.     call CheckPROFStoProceed (DidOKCUA)
  617.      if (DidOKCUA) then
  618.         copy 3000 to GiveUpTime
  619.         set pointer to SPTR_WAIT
  620.         # set up HostFileName and HostOptions
  621.         extract from ChosenPCFileNameX        # break up PC file name
  622.                 take to "." PCFileName1
  623.                 skip "."
  624.                 take to last PCFileNameExt
  625.         copy PCFileName1 to HostFileName      # build the host name VM Style
  626.         append " " PCFileNameExt to HostFileName
  627.         if (ChangeFormat is checked) then
  628.                 copy " (ASCII CRLF LRECL 255 RECFM V" to HostOptions 
  629.                                                      # if converting to EBCDIC
  630.                 copy "11" to AscOrBin                # set the options for File Transfer
  631.         else                                         # 11 means ASCII file for EPQPCPRF
  632.            copy " (LRECL 2048 RECFM V" to HostOptions 
  633.                                               # not converting, so use these options
  634.                 copy "10" to AscOrBin         # 10 means binary file for EPQPCPRF
  635.         end if
  636.  
  637.                                                       # build send command
  638.         copy ChosenPCFileName to SendCommand
  639.         append " " HostFileName to SendCommand
  640.         append " " HostOptions to SendCommand         
  641.                                                       # get ready to start a 
  642.                                                       # command processor and 
  643.                                                       # pass the SEND command 
  644.                                                       # it for file transfer
  645.         copy "/C start \"SendFile\" /C send " SendCommand to Parms 
  646.         start local SENDFILE "cmd.exe" Parms
  647.         copy "Transmitting file: " ChosenPCFileNameX "\n█" to DocMsg
  648.         change BytesSentST text to DocMsg
  649.         make BytesSentDB visible
  650.         begin                                         # respond to messages from
  651.                                                       # the SEND command
  652.                 response to char "File transfer is complete." from SENDFILE
  653.                         set pointer to SPTR_ARROW
  654.                         make BytesSentDB invisible      # Send is done
  655.                         if (PutInPROFS is checked) then
  656.                              call PutINPROFS(HostFileName)  # now put in PROFS
  657.                              if (ReplyToMessage(" ","Mail the Document?",MessageYesNo,1,MessageIconQuestion)="yes") then
  658.                                   call MailPROFS(PROFSDocNum)   # mail & erase document
  659.                                   copy ReplyToMessage(" ",DocMsg,MessageOK,1,MessageIconExclamation) to TempX
  660.                              else
  661.                                                                 # don't mail document
  662.                                   copy ReplyToMessage(" ",DocMsg,MessageOK,1,MessageIconExclamation) to TempX
  663.                              end if
  664.                         else  
  665.                              if (ReplyToMessage(" ","Transfer Complete.\nMail the File?",MessageYesNo,1,MessageIconQuestion)="yes") then
  666.                                                                 # Mail nonProfs File
  667.                                   call MailNonPROFS(HostFileName)
  668.                              end if
  669.                         end if
  670.                         stop SENDFILE
  671.                         leave block
  672.                 response to char "TRANS" from SENDFILE  # bad message from SEND
  673.                         begin guarded
  674.                           response to char "." from SENDFILE
  675.                             extract from input 
  676.                                 take number RetCode
  677.                                 skip by 2
  678.                                 take to last FTErrorMsg
  679.                             leave block
  680.                         end
  681.                         set pointer to SPTR_ARROW
  682.                         copy "File Tranfer Error.\nTRANS" RetCode " " FTErrorMsg to DocMsg
  683.                         copy ReplyToMessage(" ",DocMsg,MessageOK,1,MessageIconExclamation) to TempX
  684.                         stop SENDFILE
  685.                         leave block
  686.             response to char "Number of" from SENDFILE
  687.             append "█" to DocMsg
  688.                         change BytesSentST text to DocMsg
  689.                         make BytesSentDB visible
  690.         response to timeout 60   # one minute
  691.                         set pointer to SPTR_ARROW
  692.                         copy "File Tranfer Error.\nTransfer Timed Out " to DocMsg
  693.                         copy ReplyToMessage(" ",DocMsg,MessageOK,1,MessageIconExclamation) to TempX
  694.                         stop SENDFILE
  695.                         leave block
  696.                          
  697.         end
  698.         set pointer to SPTR_ARROW
  699.         make BytesSentDB invisible
  700.       end if
  701. #
  702. # Response Definition(s)
  703. #
  704.  
  705. response to item Send from PrimaryWindowABCUA
  706.     copy false to DidOKCUA                  
  707.     call ProcessChooseFileDB( DidOKCUA )   # jump user into box
  708.     if ( DidOKCUA ) then                   # return from box
  709.         call QueryChooseFileDB( PCListName )   # see what user did
  710.         call SetupTransferFileDB ( PCListName )  # call file transfer setup
  711.         copy false to DidOKCUA
  712.         call ProcessTransferFileDB ( DidOKCUA )  # show File Transfer DB
  713.         if ( DidOKCUA ) then                   # start file transfer
  714.              action TransferFile
  715.         end if
  716.     end if
  717.  
  718. response to item Receive from PrimaryWindowABCUA
  719.     copy false to DidOKCUA                  
  720.     call ProcessChooseFileLocationDB(DidOKCUA)
  721.     if (DidOKCUA) then
  722.        if (GetFileFromStorageRB is checked) then
  723.  
  724.           if (not HostListFound) then 
  725.              copy false to DidOKCUA                  
  726.              action TransferFromHost
  727.           else
  728.              copy false to DidOKCUA
  729.              call ProcessHostFileListDB(DidOKCUA)
  730.           end if
  731.       else
  732.           if (not PROFSListFound) then 
  733.              action TransferFromPROFS
  734.              copy false to DidOKCUA
  735.              call ProcessPROFSFileListDB(DidOKCUA)
  736.              if (DidOKCUA) then
  737.                 action GetPROFSDoc
  738.              end if
  739.           else
  740.              copy false to DidOKCUA
  741.              call ProcessPROFSFileListDB(DidOKCUA)
  742.              if (DidOKCUA) then
  743.                 action GetPROFSDoc
  744.              end if
  745.           end if
  746.       end if
  747.     end if
  748.  
  749. response to item Logoff from PrimaryWindowABCUA
  750.     action LogOffPROFS
  751.  
  752. response to item Logon from PrimaryWindowABCUA
  753.         copy "" to UserID
  754.         copy "" to PassWord
  755.         copy "" to PassWordHidden
  756.         call SetupUserIDDB(UserID,PassWordHidden,PassWord)
  757.         make UserIDDB visible
  758.         copy false to DidOKCUA
  759.         call ProcessUserIDDB(DidOKCUA)
  760.         if (DidOKCUA) then
  761.              call QueryUserIDDB(UserID,PassWordHidden,PassWord)
  762.             action LogonToPROFS
  763.         end if 
  764.  
  765. response to item ExitCUA from PrimaryWindowABCUA
  766.     exit
  767.  
  768.