home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / XTALK1.ZIP / DO.XWS < prev    next >
Encoding:
Text File  |  1990-04-30  |  1.3 KB  |  47 lines

  1. /*
  2.     Invoke scripts from a function key
  3.  
  4.     Put @do in a function key definition (Setup.Function Keys),
  5.     and use that function key to run your scripts.  DO.XWS will
  6.     ask you for the name of the script you wish to run.
  7.  
  8.     You can also put the name of a script you frequently use (plus
  9.     any arguments that script may need) in the function key defin-
  10.     ition, i.e. '@do myscript', or '@do myscript arg1 arg2', so
  11.     that DO.XWS will not have to ask you for this information.
  12.  
  13.     Copyright (C) 1989,1990 Digitial Communications Associates, Inc.
  14.     All Rights Reserved.
  15.  
  16.     Version 1.00 07-01-89 PJL
  17.     Version 1.01 09-06-89 PJL
  18. */
  19.  
  20.         xws = arg(1)
  21.  
  22. label GET_XWS
  23.         if null(xws) then
  24.         {
  25.                 alert "Enter name of script to run:", OK, CANCEL, xws
  26.                 if choice = 2 then end
  27.         }
  28.  
  29.         sfile = xws
  30.         i = instr(sfile, ".")
  31.         if i = 0 then sfile = xws + ".xws"
  32.         else xws = left(sfile,i-1)
  33.         sfile = DirXws + "\" + sfile
  34.         cfile = sfile + ".xwc"
  35.  
  36.         if exists(sfile) or exists(cfile) then
  37.         {
  38.                 chain xws
  39.                 end
  40.         }
  41.  
  42.         alert "Error: no such script "+upcase(xws), OK, CANCEL
  43.         if choice = 2 then end
  44.         xws = ""
  45.         goto GET_XWS
  46.  
  47.