home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / EASL2PRF.ZIP / FROMHOST.INC < prev    next >
Text File  |  1990-06-15  |  4KB  |  81 lines

  1.  
  2. subroutine ListHostFiles(string:HostFileName) is 
  3.        copy (text of FromEF) to Keystrokes    # Download the filelist
  4.        action EnterString                     # the PROFS screen
  5.        copy (text of ToEF) to Keystrokes
  6.        action EnterString
  7.        copy (text of SubjectEF) to Keystrokes
  8.        action EnterString
  9.        copy "DB FILE - " HostFileName " A" to Keystrokes
  10.        action EnterString
  11.        action DefineWatch              # look for EPQPCPRF panel 
  12.           copy "EPQPCPRF" to WatchChar # which tells us the result of
  13.           copy 2 to WatchCol           # the document storage function.
  14.           copy 1 to WatchRow           # the panel will display the return
  15.           copy 100 to SettleTime       # code and document number
  16.           action WatchForChar
  17.           action WatchForNoX
  18.        action WatchAndWait
  19.        if (WatchGaveUp) then
  20.           # error
  21.        else
  22.           action ScanScreen
  23.           copy 29 to FieldNumber      # get Document Number assigned
  24.           action ReadField 
  25.           copy "Store in PROFS Complete.\n" to DocMsg
  26.           append "Doc Number: " FieldText to DocMsg
  27.           copy FieldText to PROFSDocNum
  28.           copy "EPQGO" to Keystrokes   # tell EPQPCPRF goodbye
  29.           action EnterString
  30.           make BytesSentDB invisible
  31.        end if
  32.     end if
  33.     action Stop3270                       # Stop the 3270 stuff
  34.  
  35.                                               # This routine transfers the file 
  36. action TransferFromHost is                        # & calls other routines to read list
  37.     action Init3270                       # get the list of host files    
  38.     copy "LISTF * * A (EXEC" to Keystrokes
  39.     action EnterString
  40.     action DefineWatch                    # wait for response 
  41.       copy 60 to SettleTime
  42.       action WatchForNoX
  43.     action WatchAndWait
  44.     if (WatchGaveUp) then
  45.       # error
  46.     else
  47.         # set up HostFileName and HostOptions
  48.         copy "CMS$LIST.PRN" to ChosenPCFileName
  49.         copy "CMS EXEC A " to HostFileName      # build the host name VM Style
  50.         copy " (ASCII CRLF" to HostOptions      # converting to ASCII
  51.                                                       # build send command
  52.         copy ChosenPCFileName to SendCommand
  53.         append " " HostFileName to SendCommand
  54.         append " " HostOptions to SendCommand         
  55. # get ready to start a 
  56. # command processor and 
  57. # pass the RECEIVE command 
  58.                             # it for file transfer
  59.         copy "/C start \"ReceiveFile\" /C receive " SendCommand to Parms 
  60.         start local RECEIVEFILE "cmd.exe" Parms
  61.         begin                                         # respond to messages from
  62.                                                       # the SEND command
  63.             response to char "File transfer is complete." from RECEIVEFILE
  64.                         # add to list box
  65.                         read file "CMS$LIST.PRN" into HostFileListLB
  66.                         make HostFileListLB visible
  67.                         stop RECEIVEFILE
  68.                         leave block
  69.             response to line "TRANS03" from RECEIVEFILE
  70.                         copy ReplyToMessage(" ","File Transfer Complete",MessageOK,1,MessageIconExclamation) to TempX
  71.                         stop RECEIVEFILE
  72.                         leave block
  73.             response to line "TRANS026" from RECEIVEFILE  # bad message from RECEIVE
  74.                 copy ReplyToMessage(" ","File Transfer returned message TRANS026",MessageOK,1,MessageIconExclamation) to TempX
  75.                 stop RECEIVEFILE
  76.                         leave block
  77.             response to char "Number of" from RECEIVEFILE
  78.                         
  79.         end
  80.  
  81.