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

  1. /*
  2.     Run Windows apps from a function key
  3.  
  4.     Put @run in a function key definition (Setup.Function Keys),
  5.     and use that function key to run Windows applications.  RUN
  6.     will ask you for the command line you wish to run, which is
  7.     the name of the application program plus any arguments that
  8.     application may need.
  9.  
  10.     You can also put the name (and arguments) of an application
  11.     that you frequently use in the function key definition, for
  12.     example '@run myapp', or '@run myapp arg1 arg2', and RUN.XWS
  13.     will not have to ask you for this information.
  14.  
  15.     NOTES: Application names must include a file name extension.
  16.            For example, if running the Windows CALC program,
  17.            specify CALC.EXE.
  18.  
  19.            If the application is not in the Windows subdirectory 
  20.            (usually \WINDOWS), the name must contain the path.
  21.            For example, if CALC is in the \WINDOWS\UTILS directory,
  22.            specify \WINDOWS\UTILS\CALC.EXE.
  23.  
  24.     Copyright (C) 1989,1990 Digital Communications Associates, Inc.
  25.     All Rights Reserved.
  26.  
  27.     Version 1.00 07-01-89 PJL
  28.     Version 1.01 09-06-89 PJL
  29.     Version 1.1  04-11-90 PJL
  30. */
  31.  
  32.         cmdline = arg
  33.  
  34. label GET_CMD
  35.  
  36.         if null(cmdline) then
  37.         {
  38.                 alert "Enter command line to run:", OK, CANCEL, cmdline
  39.                 if choice = 2 then end
  40.         }
  41.  
  42.         if not instr(cmdline, ".") then
  43.         {
  44.                 alert "RUN requires a full filename, i.e. 'NOTEPAD.EXE'", OK, CANCEL
  45.         if choice = 2 then end
  46.                 cmdline = ""
  47.                 goto GET_CMD
  48.         }
  49.  
  50.     if not exists(cmdline) then
  51.     {
  52.         alert "Error: cannot find "+upcase(cmdline), OK, CANCEL
  53.         if choice = 2 then end
  54.         cmdline = ""
  55.         goto GET_CMD
  56.     }
  57.  
  58.         run cmdline
  59.         end
  60.