EmEditor (text editor) Forum Index Questions and Answers about EmEditor Core
Swap cpp and header files | Register To Post |
| Flat | Previous Topic | Next Topic |
| Poster | Thread |
|---|---|
| parameter | Posted on: 3/6/2012 2:19 pm |
Not too shy to talk ![]() ![]() Joined: 3/5/2012 From: Posts: 30 |
Re: Swap cpp and header files It was pretty easy to get this far:
var current_file=document.FullName; var with_out_ext=current_file.substring(0, current_file.lastIndexOf(".")); var ext=current_file.substring(current_file.lastIndexOf(".")); switch (ext) { case ".cpp": ext = ".h"; break; case ".h": ext = ".cpp"; break; } editor.OpenFile(with_out_ext+ext, 0, eeOpenAllowNewWindow); But I haven't found where to get the list of extensions from the current configuration. I'm also not sure how to test if the file exists (so I can try the next file extension if it does not exist). Tips/suggestions welcome. |
| Flat | Previous Topic | Next Topic |
| Subject | Poster | Date |
|---|---|---|
| |
parameter | 3/5/2012 12:17 pm |
| |
parameter | 3/5/2012 2:17 pm |
| |
Yutaka | 3/6/2012 8:58 am |
| » |
parameter | 3/6/2012 2:19 pm |
| Register To Post | |


