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