home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / BATWORKS.ZIP / NOTEPAD.PTB < prev    next >
Encoding:
Text File  |  1990-05-22  |  619 b   |  24 lines

  1. ; This routine adds a full path spec to the Notepad title, if possible,
  2. ; to make it available to macros
  3.  
  4. if isdefined(param1)==@false then goto plain
  5. run("notepad.exe",param1)
  6.  
  7. if strindex(param1,":",1,@fwdscan)==@true then goto NothingNeeded
  8. cwdir=dirget()
  9. i=strindex(param1,"\",strlen(param1),@backscan)
  10. if i!=@false then goto StripDirectory
  11. WinTitle("Notepad","Notepad - %cwdir%\%param1%")
  12. exit
  13.  
  14. :StripDirectory
  15. file=strsub(param1,i+1,strlen(param1)-i)
  16. WinTitle("Notepad","Notepad - %cwdir%\%file%")
  17.  
  18. :NothingNeeded
  19. WinTitle("Notepad","Notepad - %param1%")
  20. exit
  21.  
  22. :plain
  23. run("notepad.exe","")
  24.