home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d178 / rexxarplib.lha / RexxArpLib / rexx / Amiga_to_IBM.vlt < prev    next >
Text File  |  1989-02-04  |  4KB  |  162 lines

  1. /* This is a rexx macro to send stuff from the Amiga to an IBM using VLT */
  2.  
  3.  if ~showlist('l','rexxarplib.library') then address command addrexxlib
  4.  
  5.  host = address()
  6.  
  7.  ft = 'temp'
  8.  fm = 'a'
  9.  
  10.     msgstring =            "   This routine sends a file to    \"
  11.     msgstring = msgstring||"   the IBM mainframe.  To select   \"
  12.     msgstring = msgstring||"   a file to send simply use the   \"
  13.     msgstring = msgstring||"   file requestor up above.        \"
  14.     msgstring = msgstring||"   If you hit CANCEL the transfer  \"
  15.     msgstring = msgstring||"   terminates.  The same happens   \"
  16.     msgstring = msgstring||"   if you fail to choose anything  \"
  17.     msgstring = msgstring||"   and hit OK.                   "
  18.  
  19.     y = postmsg(326,178,msgstring,host)
  20. done = 0
  21. do outer = 1 until done = 1
  22.  
  23.  
  24.   filerep = getfile(326,56,,,"CLICK DIRECTORY AND/OR FILE",host)
  25. /* this checks to see that not everything is blank. */
  26.  
  27.   if filerep = '' then do
  28.       x=postmsg()
  29.       exit
  30.   end
  31.  
  32. /* here we check to see that we got a file and not just a directory */
  33.  
  34.   dircheck = statef(filerep)
  35.   dirnum = index(dircheck,"DIR")
  36.   if dirnum ~= 0 then do
  37.     msgstring =            "   The name of the file itself \"
  38.     msgstring = msgstring||"   should appear in the lower  \"
  39.     msgstring = msgstring||"              box.             \"
  40.     msgstring = msgstring||"                               \"
  41.     msgstring = msgstring||"           TRY AGAIN           \"
  42.     msgstring = msgstring||"     (click left mouse button) \"
  43.    
  44.     y = postmsg(,,msgstring,host)
  45.     iterate outer
  46.   end
  47.  
  48.     x=postmsg()
  49.  
  50.     parse var filerep dir ":" filerep
  51.     if filerep = "" then do
  52.      filerep = dir
  53.      dir = ":"
  54.     end 
  55.     else dir = dir":"
  56.     filerep = reverse(filerep)
  57.     parse var filerep filename "/" subdir
  58.     filename = reverse(filename)
  59.      
  60.     sendfile = dir||reverse(filerep)
  61.     
  62.     parse var filename xfn"."xft
  63.     if xft ~= "" then ft = xft
  64.  
  65.     
  66. fillstring = ""
  67.   fillstring = fillstring||"What do you wish it to be called\"
  68.   fillstring = fillstring||"on the main frame?\"
  69.   fillstring = fillstring||"The name shown below is the default\"
  70.   fillstring = fillstring||"To assign your own name type over it"
  71.  
  72. defaultname = xfn" "ft" a"
  73.  
  74. ibmname = request(326,56,fillstring,defaultname,"Send It","Cancel",host)
  75.  
  76. if ibmname = "" then exit
  77.  
  78. if ibmname ~= defaultname then do
  79.  
  80.   parse var ibmname ifn ift ifm
  81.   
  82.   select
  83.   
  84.     when ifn  = '' then ibmname = fn" "ft" "fm
  85.     when ifn ~= '' & ift = '' then ibmname = ifn" "ft" "fm
  86.     when ift ~= '' & ifm = '' then ibmname = ifn" "ift" "fm
  87.     otherwise ibmname = ifn" "ift" "ifm
  88.  
  89.   end 
  90.  
  91. end
  92. if host ~= "VLT" then x = screentofront("VLT")
  93.  
  94. if host ~= "VLT" then address VLT
  95.  
  96.        sendstring = "kermit receive "||ibmname" *R"
  97.        sendstring = '"'||sendstring||'"'
  98.  
  99.         SEND "*R"
  100.         call delay 100
  101.  
  102.     SEND "*X7"
  103.         call delay 50
  104.  
  105.     SEND "*R"
  106.         call delay 50
  107.     SEND "*R"
  108.  
  109.  
  110.         SEND sendstring
  111.         
  112.         call delay 250
  113.  
  114.         KS sendfile 
  115.         if host ~= "VLT" then address command x=screentoback("VLT")
  116.  
  117.         SEND "*R"
  118.  
  119.         call delay 50
  120.  
  121.         SEND "*R*R"
  122.  
  123.         call delay 50
  124.  
  125.         SEND "*R"
  126.  
  127.         SEND "*R"
  128.  
  129.         SEND "*N"       
  130.  
  131.     done = 1
  132.  
  133. end
  134.  
  135. if host ~= "VLT" then x = screentoback("VLT")
  136. exit
  137.  
  138. ERROR:
  139.  
  140.    say "There has been an error somewhere "
  141.    exit 20
  142.  
  143. SYNTAX:
  144.    say "Syntax error"
  145.    exit 20
  146.  
  147.  
  148. NOVALUE:
  149.    say "Novalue error"
  150.    exit 20
  151.  
  152. HALT:
  153.  
  154.    say "External Halt detected"
  155.    exit 20
  156.  
  157. BREAK:
  158.  
  159.   say "Control C detected"
  160.   exit 20
  161.  
  162.