home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR8 / TCD11.ZIP / DIRCHNG.DOC < prev    next >
Text File  |  1993-06-03  |  3KB  |  80 lines

  1. The following macro will cause TSE to change to the directory that you load
  2. a file from.  To use this macro, add the following code on after the
  3. #include lines at the top of the TSE.S file located in your UI sub-directory:
  4.  
  5. /************************************************************************
  6.     ;
  7.     ; This comment is just to show the code that is in the BIN file.
  8.     ; It does not have to be included in your file.
  9.     ;
  10.     ; integer cd(string s)
  11.     ;
  12.     ; cd('..' + Chr(0))
  13.     ;
  14.     ; long PASCAL cd(uchar *far string);
  15.     ;
  16.     ;                       bp+06 seg string
  17.     ;                       bp+04 ofs string
  18.     ;                       bp+02 seg ret
  19.     ;                       bp+00 ofs ret
  20.     ;
  21.     cd proc
  22.             mov     bp,sp
  23.             lds     dx,[bp+4]               ; ofs string
  24.             inc     dx                      ; move past the length
  25.             inc     dx                      ;    word
  26.             mov     ah,3bh                  ; change dir
  27.             int     21h                     ; dos call
  28.             mov     ax, 0                   ; assume error...
  29.             jc      @@exit
  30.             inc     ax                      ; single success
  31.     @@exit:
  32.             cwd
  33.             retf
  34.     cd endp
  35.  ************************************************************************/
  36.  
  37. binary ['dirchng.bin']
  38.     integer proc cd(string dir):0
  39. end
  40.  
  41. proc mEditFile()
  42.     string temp[80] = ''
  43.     EditFile()
  44.     LogDrive(SplitPath(CurrFilename(),_DRIVE_))
  45.     temp = SplitPath(CurrFilename(), _PATH_)
  46.     if temp <> '\'
  47.         temp = SubStr(temp, 1, Length(temp) - 1)
  48.     endif
  49.     cd(temp + Chr(0))
  50. end
  51.  
  52. Once you have done this, change the line in your MENU FileMenu()(located in
  53. the section of the TSE.S file titled 'The Menus') from:
  54.  
  55.     "&Open..."                      ,   EditFile()
  56.  
  57. to:
  58.  
  59.     "&Open..."                      ,   mEditFile()
  60.  
  61. Then in the TSE.KEY file in your UI sub-directory change the line:
  62.  
  63.     <Alt e>                 Editfile()
  64.  
  65. to:
  66.  
  67.     <Alt e>                 mEditfile()
  68.  
  69. This uses a binary file DIRCHNG.BIN (found in this ZIP file).  Place the BIN
  70. file in your UI sub-directory.
  71.  
  72. Once you have made the modification to your TSE files, move to your \TSE
  73. directory (the directory where you installed TSE) and use SC.EXE to update
  74. your E.EXE.  To run SC use the following syntax:
  75.  
  76. SC -b ui\tse
  77.  
  78. Once you have made these modifications, TSE will change to the directory
  79. where you load a file from.
  80.