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

  1. /*
  2.     Edit a file from a function key
  3.  
  4.     This script will invoke your editor (NOTEPAD is used as a default)
  5.     to edit a file.  EDIT.XWS uses .XWS as a default file extension, so
  6.     if you wish to edit a script file, you can just type in the name of
  7.     the script when EDIT asks you what file you want to edit.
  8.  
  9.     Copyright (C) 1989, 1990 Digital Communications Associates, Inc.
  10.     All rights reserved.
  11.  
  12.     Version 1.0 07-01-89 PJL
  13. */
  14.  
  15.         string fname
  16.  
  17.         fname = arg(1)
  18.         if null(fname) then {
  19.                 alert "Enter name of file to edit: ", OK, CANCEL, fname
  20.                 if choice = 2 then end
  21.         }
  22.  
  23.         if not instr(fname, ".") then {
  24.                 fname = fname + "."
  25.                 if not exists(fname) then {
  26.                         fname = fname + "xws"
  27.                         drive left(DirXws,2)
  28.                         chdir DirXws
  29.                 }
  30.         }
  31.         else if upcase(right(fname,3)) = "XWS" then {
  32.                 drive left(DirXws,2)
  33.                 chdir DirXws
  34.         }
  35.  
  36.         if null(Editor) then run "notepad.exe " + fname
  37.         else run Editor + " " + fname
  38.  
  39.         end
  40.