home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff226.lzh / Vlt / rexx / Amiga_to_IBM.vlt < prev    next >
Text File  |  1989-06-25  |  3KB  |  123 lines

  1. /* this is a test for a window which pulls stuff */
  2. parse arg filestuff 'SCREEN' screen 
  3. parse var filestuff filerep ibmname
  4. screen = strip(screen) 
  5. wildcard = 0
  6.  
  7.  
  8.  if ~showlist('l','rexxarplib.library') then address command addrexxlib
  9.  host = address()
  10.  if host = 'VLT' then screen = 'VLT'
  11.  
  12. /* if filerep is defined then don't do this */
  13.  
  14. if filerep = "" then do 
  15.  
  16.   msgstring =            "   This routine sends a file to    \"
  17.   msgstring = msgstring||"   the IBM mainframe.  To select   \"
  18.   msgstring = msgstring||"   a file to send simply use the   \"
  19.   msgstring = msgstring||"   file requestor up above.        \"
  20.   msgstring = msgstring||"   If you hit CANCEL the transfer  \"
  21.   msgstring = msgstring||"   terminates.  The same happens   \"
  22.   msgstring = msgstring||"   if you fail to choose anything  \"
  23.   msgstring = msgstring||"   and hit OK.                      "
  24.  
  25.   y = postmsg(326,178,msgstring,screen)
  26.   done = 0
  27.  
  28.   do outer = 1 while done = 0
  29.  
  30.  
  31.     filerep = getfile(326,56,,,"CLICK DIRECTORY AND/OR FILE",screen)
  32.     wildcard = index(filerep,"*")
  33.  
  34.     /* this checks to see that not everything is blank. */
  35.  
  36.     if filerep = '' then do
  37.       x=postmsg()
  38.       exit
  39.     end
  40.  
  41.     /* here we check to see that we got a file and not just a directory */
  42.  
  43.     dircheck = statef(filerep)
  44.     dirnum = index(dircheck,"DIR")
  45.     if dirnum ~= 0 then do
  46.       msgstring =            "   The name of the file itself \"
  47.       msgstring = msgstring||"   should appear in the lower  \"
  48.       msgstring = msgstring||"              box.             \"
  49.       msgstring = msgstring||"                               \"
  50.       msgstring = msgstring||"           TRY AGAIN           \"
  51.       msgstring = msgstring||"     (click left mouse button) \"
  52.    
  53.       y = postmsg(,,msgstring,screen)
  54.       iterate outer
  55.     end
  56.     x=postmsg()
  57.     done = 1  
  58.   end 
  59.  
  60. end
  61. /* if filerep is defined then skip to here */
  62.  
  63.     parse var filerep dir ":" filerep
  64.     if filerep = "" then do
  65.      filerep = dir
  66.      dir = ":"
  67.     end 
  68.     else dir = dir":"
  69.     filerep = reverse(filerep)
  70.     parse var filerep filename "/" subdir
  71.     filename = reverse(filename)
  72.      
  73.     sendfile = dir||reverse(filerep)
  74.     
  75.     parse var filename xfn"."xft
  76.     if xft = "" then xft = "temp"
  77.     defaultname = xfn" "xft" a"
  78.  
  79. /* if no ibm name is supplied do */
  80. if wildcard = 0 then do
  81.  
  82.   if ibmname = "" then do 
  83.     fillstring = ""
  84.     fillstring = fillstring||"What do you wish it to be called\"
  85.     fillstring = fillstring||"on the main frame?\"
  86.     fillstring = fillstring||"The name shown below is the default\"
  87.     fillstring = fillstring||"To assign your own name type over it"
  88.  
  89.  
  90.     ibmname = request(326,56,fillstring,defaultname,"Send It","Cancel",screen)
  91.  
  92.     if ibmname = "" then exit
  93.   end 
  94. end
  95. /* if an ibmname was supplied then skip to here */
  96.  
  97.   if ibmname ~= "" & ibmname ~= defaultname then do
  98.  
  99.     parse var ibmname ifn ift ifm
  100.   
  101.      select
  102.   
  103.        when ifn  = '' then ibmname = fn" "ft" "fm
  104.        when ifn ~= '' & ift = '' then ibmname = ifn" "xft" "fm
  105.        when ift ~= '' & ifm = '' then ibmname = ifn" "ift" "fm
  106.        otherwise ibmname = ifn" "ift" "ifm
  107.      end 
  108.    end
  109.  
  110. if host ~= "VLT" & screen ~= 'VLT' then call screentofront("VLT")
  111.  
  112. if host ~= "VLT" then address VLT
  113.  
  114.        if wildcard ~=0 then ibname = ""
  115.  
  116.        call "rexx:gensend.rexx"(sendfile||" AS "||ibmname)
  117.  
  118. address command       
  119. if host ~= "VLT" & screen ~= 'VLT' then call screentoback("VLT")
  120.  
  121. exit 
  122.  
  123.