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
   Swap cpp and header files parameter 3/5/2012 12:17 pm
     Re: Swap cpp and header files parameter 3/5/2012 2:17 pm
       Re: Swap cpp and header files Yutaka 3/6/2012 8:58 am
       » Re: Swap cpp and header files parameter 3/6/2012 2:19 pm

Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文