Access Open Source Files with Ease Using the EmEditor Text Editor in C++

Access Open Source Files with Ease Using the EmEditor Text Editor in C++

William Lv8

Access Open Source Files with Ease Using the EmEditor Text Editor in C++

Viewing 1 post (of 1 total)

  • Author
    Posts

  • March 21, 2008 at 6:02 pm #5598
    shaohao
    Member
    This Macro is useful when you are writing C/C++ code with EmEditor. It will switch between .h and .c/.cpp files.

    #title = “”
    #tooltip = “C/C++<->H”

    fso = new ActiveXObject(“Scripting.FileSystemObject”);

    // get file full name
    fn = document.FullName;

    // get base name and extension
    base = fso.GetParentFolderName(fn) + “” + fso.GetBaseName(fn);
    ext = fso.GetExtensionName(fn);
    if (ext == “”) Quit();

    // get file name to be opened
    if (ext.toLowerCase() == “h”) {
    fn = base + “.cpp”;
    if (! fso.FileExists(fn)) fn = base + “c”;
    } else if (ext.toLowerCase() == “c” || ext.toLowerCase() == “cpp”) {
    fn = base + “.h”;
    } else {
    Quit(); // unsupported


    // open the file
    if (fso.FileExists(fn)) editor.OpenFile(fn, 0, eeOpenAllowNewWindow);

  • Author
    Posts

Viewing 1 post (of 1 total)

  • You must be logged in to reply to this topic.

Also read:

https://techidaily.com
  • Title: Access Open Source Files with Ease Using the EmEditor Text Editor in C++
  • Author: William
  • Created at : 2024-10-10 11:54:15
  • Updated at : 2024-10-14 07:07:02
  • Link: https://win-premium.techidaily.com/access-open-source-files-with-ease-using-the-emeditor-text-editor-in-cplusplus/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Access Open Source Files with Ease Using the EmEditor Text Editor in C++