CMAC issue – can not remove windows after running a script.

Product Compare Forums Multi-Edit Support CMAC issue – can not remove windows after running a script.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2999
    MewUser
    Participant

    Using latest version of MEW on Windows 7 Ultimate 32 bit, I have created a script to put a list of files in a directory into a file.
    From this file, I open it up, and then, line by line, open up the file on the corresponding line.
    I then search for specific characters in these files, and update a log file if I find the characters.

    After I run the script, I notice that I can not delete any existing windows, either by the menu or by key shortcut. I use session manager, and the only way that I can get rid of the windows is to delete the session.

    Creating a new session results in the same behavior.

    I have not experienced this issue on similar scripts in the past.

    #9688
    Clay Martin
    Keymaster

    Hi,
    Can you close a window that was open before running the script, after running it, or just the windows the script opens? Can you include your script?

    Thanks,
    Clay

    #9689
    MewUser
    Participant

    Clay,

    I can not close any file that was open prior to running the script or after. If I add new files after running this script, then attempt to close the newly added file, the file stays open, and a new entry is added to the tabs, with the lines in the .sh file as the heading, i.e.,
    macro_file MEWTest;
    prototype MEWTest

    [code:1ulzsyin]
    macro_file MEWTest;
    #include Common.sh
    #include WINEXEC.SH
    #include WINError.sH
    #include StdDlgs.sh
    #include MEWTest.sh
    #include c.sh //defines _c_whitespace as space, tab, or virtual space
    #include Dialog.sh
    #include DbTools.sh
    #include Language.sh
    #include MeTags.sh
    #include RegExp.sh
    #include Misc.sh
    #include Messages.sh // added for dialogs ...
    #include Win32.sh
    /*
    This file includes the following macros and functions
    void CreateDirList() // Create a customized batch file for a directory listing
    void DetermineMaxFiles() // Function to determine the max number of files present in a file
    void Initialize() // Function to initialize items
    void CheckDXLFiles() // Function to check if compare files are different from Beyond Compare
    void CheckFile() // Function to run CompareCheck on all files in a list file
    void CompareCheck(str FileString) // function to search for <> in DXL compare files
    void WriteData(int file_not_yet_created, str LogFile, str TextString) // function to write data to a file
    void RunCompareBatch() // Run c:\dxl\FileCompare.bat

    End of macros and functions
    */

    void CreateDirList() // Create a customized batch file for a directory listing
    {
    str DirBat;
    int Flags, DOS_result;
    int CallingWindowID = Window_ID;
    str OutputFile,WorkingDir,FileList;
    str CText = "C:\\text\\";
    str StrType = "";
    int TurnOffRefresh, T_Refresh = refresh;
    TurnOffRefresh = SetRefresh();

    WorkingDir = "C:\\DoorsScripts\\Diff"; // mapped drive
    StrType = "DXLFiles.txt";
    OutputFile = CText + StrType;
    FileList = "dir /b "+WorkingDir+" > "+OutputFile;
    Set_Global_Str(‘DXLCheck’, OutputFile);
    DirBat = "c:\\bat\\dirNew.bat";
    // Need to delete c:\bat\dirnew.bat
    CloseAndDeleteFile(DirBat);
    LoadFiles(DirBat);
    // create a new c:\bat\dirnew.bat consisting of FileList
    text(FileList);
    // Save c:\bat\dir.bat
    SaveTheFile();
    /*
    Here is the prototype for the call int ExecProg(str Prog, // = Parse_Str("/PROG=", Mparm_Str),// The command line
    str Working_Dir, // Parse_Str("/WD=",Mparm_Str),
    str StdOut_File, // = Parse_Str("/RED=", Mparm_Str), // The filename to output STDOUT to (DOS .EXE files only)
    str StdErr_File, // = Parse_Str("/REDERR=", Mparm_Str),// The filename to output STDERR to (DOS .EXE files only)
    int Flags // = Parse_Int("/FLAGS=", Mparm_Str ) // Flags; see #define _EP_FLAGS_xxxx above
    );
    */
    /* MsgDlg("Go to a DOS Command line, and in C:\\bat"+
    "\\ntype the following:"+
    "\\ndirnew"+
    "\\nthen press enter"+
    "\\nClick OK when finished",
    "Status", "", 1 );
    */
    Flags = _EP_Flags_SkipExec; // Run as a Dos program
    DOS_result = ExecProg( "c:\\bat\\dirNew.bat", WorkingDir, OutputFile, ”, Flags );
    if(DOS_result != 0)
    {
    MsgDlg ("DOS_result is " + str(DOS_result), "Error", "", 1);
    } // end if(DOS_result != 0)
    switch_win_id(CallingWindowID);
    WorkingDir += "\\"; // Add backslash to path
    Set_Global_Str(‘BasePath’, WorkingDir);
    ReSetRefresh(TurnOffRefresh, T_Refresh); // return screen updating to prior
    } // CreateDirList

    void DetermineMaxFiles() // Function to determine the max number of files present in a file
    {
    int OriginalWindowID = Global_Int(‘OriginalWinID’);
    int DXLWindowID = Global_Int(‘DXL_FILE_WINDOW_ID’);
    int EndLine = 0;

    switch_win_id(DXLWindowID);
    eof;
    EndLine = c_line;
    Set_Global_Int(‘TotalDXLFiles’, EndLine);
    switch_win_id(OriginalWindowID);
    } // DetermineMaxFiles

    void Initialize() // Function to initialize items
    {
    Set_Global_Int(‘START_ID’,1); // Set this so that the log file gets created
    str FileType = Global_Str(‘DXLCheck’);
    int ResultStatus = LoadFiles(FileType);
    Set_Global_Int(‘DXL_FILE_WINDOW_ID’,ResultStatus);
    Set_Global_Int(‘LOG_WINDOW_ID’,0); // Set to default
    } // Initialize

    void CheckDXLFiles() // Function to check if compare files are different from Beyond Compare
    {
    int OriginalWindowID = Window_ID;
    int TurnOffRefresh, T_Refresh = refresh;
    TurnOffRefresh = SetRefresh();
    Set_Global_Int(‘OriginalWinID’,OriginalWindowID);
    str WorkingDir = "C:\\DoorsScripts\\Diff"; // mapped drive
    /* File_Exists ( filename ) integer function
    RETURNS:
    0 File does not exist
    1 File exists
    2 File is a directory
    */
    int DirExists = File_Exists(WorkingDir);
    if (DirExists == 2)
    {
    RunCompareBatch();
    CreateDirList();
    Initialize();
    DetermineMaxFiles();
    CheckFile();
    } // end if (DirExists == 2)
    else
    MsgDlg (WorkingDir + " Does not exist! "+str(DirExists), "Error", "", 1);

    ReSetRefresh(TurnOffRefresh, T_Refresh); // return screen updating to prior
    } // CheckDXLFiles

    void CheckFile() // Function to run CompareCheck on all files in a list file
    {
    int TurnOffRefresh, T_Refresh = refresh;
    TurnOffRefresh = SetRefresh();
    int OriginalWindowID;
    int DXLWindowID = Global_Int(‘DXL_FILE_WINDOW_ID’);
    int Loop, MaxLoop = Global_Int(‘TotalDXLFiles’);
    str FileNameToCheck;
    int CurrentLine = 1;
    switch_win_id(DXLWindowID);
    tof;

    for ( Loop = 0; Loop < MaxLoop; Loop++)
    {
    goto_col(1);
    CurrentLine = c_line;
    Set_Global_Int(‘DXLFileLine’, CurrentLine);
    FileNameToCheck = Get_Word(”);
    //MsgDlg ("CheckFile -> FileNameToCheck " +FileNameToCheck, "Status", "", 1);
    CompareCheck(FileNameToCheck);
    DXLWindowID = Global_Int(‘DXL_FILE_WINDOW_ID’);
    switch_win_id(DXLWindowID);
    CurrentLine = Global_Int(‘DXLFileLine’);
    goto_line(CurrentLine);
    down;
    } // end for ( Loop = 0; Loop < MaxLoop; Loop++)
    OriginalWindowID = Global_Int(‘OriginalWinID’);
    switch_win_id(OriginalWindowID);
    ReSetRefresh(TurnOffRefresh, T_Refresh); // return screen updating to prior
    } // CheckFile()

    void CompareCheck(str FileString) // function to search for <> in DXL compare files
    {
    int DialogActive = 0;
    int TurnOffRefresh, T_Refresh = refresh;
    int SearchResult = 0;
    int file_not_yet_created;
    str LogFile = "c:\\text\\DXLCompare.txt";
    str TextString = "";
    str BlankLine = "";
    int ResultStatus;
    str FullPath;
    str Base = Global_Str(‘BasePath’);
    int OriginalWindowID = 0;

    TurnOffRefresh = SetRefresh();
    FullPath = Base + FileString;
    ResultStatus = LoadFiles(FullPath);
    Set_Global_Int(‘DXL_WINDOW_ID’,ResultStatus);
    OriginalWindowID = Global_Int(‘DXL_WINDOW_ID’);
    switch_win_id(OriginalWindowID);
    TOF; // Go to the top of the file
    while(!at_eof)
    {
    SearchResult = SEARCH_FWD("<>", 0);
    if ( SearchResult == 1)
    {
    file_not_yet_created = Global_Int(‘START_ID’);
    WriteData(file_not_yet_created, LogFile, BlankLine);
    file_not_yet_created = Global_Int(‘START_ID’);
    TextString = "Differences found in this file";
    WriteData(file_not_yet_created, LogFile, TextString);
    WriteData(file_not_yet_created, LogFile, FileString);
    } // end if ( SearchResult == 1)
    // Close the open file here
    DelWindowInList(FullPath, FullPath); // close the window that is open in MEW
    OriginalWindowID = Global_Int(‘DXL_WINDOW_ID’);
    switch_win_id(OriginalWindowID);
    down;
    if (at_eof)
    {
    goto CTEnd;
    } // end if (at_eof)
    } // end while(!at_eof)
    CTEnd:
    ReSetRefresh(TurnOffRefresh, T_Refresh); // return screen updating to prior
    TextString = "See Output at " + LogFile;
    Make_Message (TextString);
    } // CompareCheck

    void WriteData(int file_not_yet_created, str LogFile, str TextString) // function to write data to a file
    {
    int OriginalWindow, WindowNumber;

    if ( file_not_yet_created == 1)
    {
    if (FILE_EXISTS(LogFile))
    {
    CloseAndDeleteFile(LogFile);
    } // end if (FILE_EXISTS(LogFile))
    if (ERROR_LEVEL != 0)
    {
    error_level = 0;
    } // end if (ERROR_LEVEL != 0)
    WindowNumber = LoadFiles(LogFile);
    Set_Global_Int(‘LOG_WINDOW_ID’, WindowNumber);
    file_not_yet_created = 0;
    Set_Global_Int(‘START_ID’,file_not_yet_created);
    } // end ( file_not_yet_created == 1)
    WindowNumber = Global_Int(‘LOG_WINDOW_ID’);
    SWITCH_WIN_ID(WindowNumber);
    goto_col(1);
    text(TextString);
    cr;
    SaveTheFile();
    OriginalWindow = Global_Int(‘DXL_WINDOW_ID’); // Set to default
    SWITCH_WIN_ID(OriginalWindow);
    } // WriteData

    void RunCompareBatch() // Run c:\dxl\FileCompare.bat
    {
    int Flags, DOS_result;
    int CallingWindowID = Window_ID;
    str BatchFile = "C:\\DXL\\FileCompare.bat";
    str StrType = "";
    int TurnOffRefresh, T_Refresh = refresh;
    TurnOffRefresh = SetRefresh();

    /*
    Here is the prototype for the call int ExecProg(str Prog, // = Parse_Str("/PROG=", Mparm_Str),// The command line
    str Working_Dir, // Parse_Str("/WD=",Mparm_Str),
    str StdOut_File, // = Parse_Str("/RED=", Mparm_Str), // The filename to output STDOUT to (DOS .EXE files only)
    str StdErr_File, // = Parse_Str("/REDERR=", Mparm_Str),// The filename to output STDERR to (DOS .EXE files only)
    int Flags // = Parse_Int("/FLAGS=", Mparm_Str ) // Flags; see #define _EP_FLAGS_xxxx above
    );
    */
    /* MsgDlg("Go to a DOS Command line, and in C:\\bat"+
    "\\ntype the following:"+
    "\\ndirnew"+
    "\\nthen press enter"+
    "\\nClick OK when finished",
    "Status", "", 1 );
    */
    Flags = _EP_Flags_SkipExec; // Run as a Dos program
    DOS_result = ExecProg( "c:\\DXL\\FileCompare.bat", StrType, StrType, ”, Flags );
    if(DOS_result != 0)
    {
    MsgDlg ("DOS_result is " + str(DOS_result), "Error", "", 1);
    } // end if(DOS_result != 0)
    switch_win_id(CallingWindowID);
    ReSetRefresh(TurnOffRefresh, T_Refresh); // return screen updating to prior
    } // RunCompareBatch

    [/code:1ulzsyin]

    Here is the prototype file
    [code:1ulzsyin]
    prototype MEWTest
    {
    void CreateDirList(); // Create a customized batch file for a directory listing
    void DetermineMaxFiles(); // Function to determine the max number of files present in a file
    void Initialize(); // Function to initialize items
    void CheckDXLFiles(); // Function to check if compare files are different from Beyond Compare
    void CheckFile(); // Function to run CompareCheck on all files in a list file
    void CompareCheck(str FileString); // function to search for <> in DXL compare files
    void WriteData(int file_not_yet_created, str LogFile, str TextString); // function to write data to a file
    void RunCompareBatch(); // Run c:\dxl\FileCompare.bat
    }
    [/code:1ulzsyin]

    Here is the batch file – FileCompare.bat
    [code:1ulzsyin]
    "C:\Program Files\Beyond Compare 3\BCompare.exe" @"C:\Beyond Compare Scripts\Diff.txt" "c:\DoorsScripts\AnalyzedCount.dxl" "c:\DXL\AnalyzedCount.dxl" "c:\DoorsScripts\Diff\AnalyzedCount_diff.txt"
    "C:\Program Files\Beyond Compare 3\BCompare.exe" @"C:\Beyond Compare Scripts\Diff.txt" "c:\DoorsScripts\AnalyzeSPR.dxl" "c:\DXL\AnalyzeSPR.dxl" "c:\DoorsScripts\Diff\AnalyzeSPR_diff.txt"
    "C:\Program Files\Beyond Compare 3\BCompare.exe" @"C:\Beyond Compare Scripts\Diff.txt" "c:\DoorsScripts\CheckDVP.dxl" "c:\DXL\CheckDVP.dxl" "c:\DoorsScripts\Diff\CheckDVP_diff.txt"
    "C:\Program Files\Beyond Compare 3\BCompare.exe" @"C:\Beyond Compare Scripts\Diff.txt" "c:\DoorsScripts\CheckELModule.dxl" "c:\DXL\CheckELModule.dxl" "c:\DoorsScripts\Diff\CheckELModule_diff.txt"
    "C:\Program Files\Beyond Compare 3\BCompare.exe" @"C:\Beyond Compare Scripts\Diff.txt" "c:\DoorsScripts\CheckText.dxl" "c:\DXL\CheckText.dxl" "c:\DoorsScripts\Diff\CheckText_diff.txt"
    "C:\Program Files\Beyond Compare 3\BCompare.exe" @"C:\Beyond Compare Scripts\Diff.txt" "c:\DoorsScripts\ClearTestStatus.dxl" "c:\DXL\ClearTestStatus.dxl" "c:\DoorsScripts\Diff\ClearTestStatus_diff.txt"
    "C:\Program Files\Beyond Compare 3\BCompare.exe" @"C:\Beyond Compare Scripts\Diff.txt" "c:\DoorsScripts\CopyLinks.dxl" "c:\DXL\CopyLinks.dxl" "c:\DoorsScripts\Diff\CopyLinks_diff.txt"
    [/code:1ulzsyin]

    #9690
    Clay Martin
    Keymaster

    Hi,
    If you have more than 9 files open, you can go to Window-More Windows (bottom of menu), and get a dialog that lists all the open windows. Please note if the files your script opened (or any that were already open have the attributes linked, hidden, modified, etc. There is a button on the dialog "Close File", see if you can select one of the files and close it from there.

    Also, while looking over your code I found references to functions that I can neither find defined in your macro code, in the source CMac files(*.s) distributed with Multi-Edit, or in any of the documentation. Some of these are:
    SetRefresh()
    CloseAndDeleteFile
    LoadFiles
    SaveTheFile()
    Where are these defined?

    Thanks,
    Clay

    #9691
    MewUser
    Participant

    Clay, the files that you reference are in a file that I call common.s, which is a huge file full of functions that I created.

    It does not matter how many files are open, close file does not seem to close the file.

    I can exit MEw, restart it, and the existing files in the session manager remain from before the restart, and I cannot close them by any means, other than deleting the session.

    This type of behavior has just started, around the time that I worked on the above functions.

    If you need common.s, I will not post it here, is there another method that I can get that to you?

    Now, it does not matter which session I open, whenever I add a file then attempt to close it, or it was there from the session close, still unable to close the file.

    No error message is seen.

    Any ideas?

    Thanks

    #9692
    Clay Martin
    Keymaster

    Hi,
    I suspect that the windows will not close because of how they were opened, or possibly some flag/attribute being set. Did you examine the "more windows" dialog and see if you could close them from there? Since it is the running of your macro that is making the change to the system so that the windows will not close, I would need to see the code that is being executed to have any chance of spotting the problem. If you have used your library of functions for many other macros, is there some part of that that you have changed recently, other than the top level code? There are a number of depreciated macros (like using ldfiles instead of an earlier file opening functions) that if still in use could maybe cause this problem. Maybe you could isolate the functions you use in this script and just post them.

    Thanks,
    Clay

    #9693
    MewUser
    Participant

    Clay, I have created a Test.s and Test.sh file, and by replacing Common.sh with Test.sh, this compiles without issue.

    I do not remember making any modifications to the functions below.

    Here is Test.s
    [code:3so9brhq]
    macro_file Test;
    #include Test.sh
    #include StdDlgs.sh

    /*
    This file includes the following macros and functions
    str TranslateDOS(int result) // Function to return a string based on DOS result
    int ErrorReport(int DOS_result) // function to print out error information
    int MsgDialog(str InfoString, str TitleString) // Function to call MsgDlg, inserting first two parameters
    int FindWindowInList(str FileToBeTested, int DebugString) // Function to find an MEW window in the Window list
    int LoadFiles(str NewFileStr) // Function to load files based on MEW definition
    int SetRefresh() // Function to set refresh based on DOS or Windows
    int SetRefreshToTrue() // Function to set refresh to TRUE state
    int ReSetRefresh(int TurnOffRefresh, int T_Refresh) // Function to reset refresh
    int DeleteFileType(str FileToBeDeleted) // Function to delete a specific file
    void DelWindowInList(str FileToBeTested, str CapFileName) // Function to delete an MEW window in the Window list
    int CloseAndDeleteFile(str FileStr) // Function to close a file, then delete it
    int SaveTheFile() // Function to perform file saving with related checking

    End of macros and functions
    */

    str TranslateDOS(int result) // Function to return a string based on DOS result
    {
    str ResultStr = " ";
    // definitions in winerror.sh
    Switch(result)
    {
    case 32 :
    ResultStr = " Another Application is viewing this file!";
    break;
    case 5 :
    ResultStr = " The file is in use, check!";
    break;
    case 3 :
    ResultStr = " Invalid subdirectory...file does not exist!";
    // attempting to copy a common file from share results in c:\My Projects\common\Modetest\modetest.cpp, which is invalid
    break;
    case 2 :
    ResultStr = " Invalid path name!";
    break;
    case 4 :
    ResultStr = " Too many files open!";
    break;
    case 1 :
    ResultStr = " Invalid function!";
    break;
    default:
    ResultStr = " Unknown " + str(result);
    break;
    } // end Switch(result)
    return(ResultStr);
    } // TranslateDOS

    int ErrorReport(int DOS_result) // function to print out error information
    {
    str ErrorStr, OutputString;
    str TitleString = "Error";
    OutputString = "DOS_result is "+str(DOS_result);
    ErrorStr = TranslateDOS(DOS_result);
    // MsgDlg ( "DOS_result is " + str(DOS_result) + ErrorStr, "Error", "", 1);
    OutputString = OutputString + ErrorStr;
    MsgDialog(OutputString, TitleString);
    return(1);
    } // ErrorReport

    int MsgDialog(str InfoString, str TitleString) // Function to call MsgDlg, inserting first two parameters
    {
    MsgDlg(InfoString, TitleString, "",1);
    return(1);
    } // MsgDialog

    int FindWindowInList(str FileToBeTested, int DebugString) // Function to find an MEW window in the Window list
    {
    int Loop, WindowsOpen, ReturnValue = 0;
    str CapFileName;

    FileToBeTested = CAPS(FileToBeTested);
    // if (DebugString)
    // MsgDlg ( "FindWindowInList Called", "FindWindowInList", "", 1);
    WindowsOpen = Window_Count;
    for ( Loop = 1; Loop <= WindowsOpen; Loop++)
    {
    Switch_Window(Loop);
    CapFileName = CAPS(File_Name);
    if (DebugString)
    MsgDlg ( "File is " + CapFileName + " Common " +FileToBeTested, "File", "", 1);
    if ( CapFileName == FileToBeTested)
    {
    // return the window id value here!
    ReturnValue = Window_ID;
    break;
    } // end if ( CapFileName == FileToBeTested)
    } // end for ( Loop = 1; Loop <= WindowsOpen; Loop++)
    return(ReturnValue);
    } // FindWindowInList

    int LoadFiles(str NewFileStr) // Function to load files based on MEW definition
    {
    str OutputString, TitleString = "Load File Error";
    int ReturnValue = 0, DebugString = 0;
    if (!FindWindowInList(NewFileStr, DebugString))
    {
    RM("LDFILES /LC=1/FN="+NewFileStr);
    } // end if (!FindWindowInList(NewFileStr, DebugString))
    //MsgDlg ( "FileName is " + NewFileStr, "LoadFiles FileName", "", 1);
    //MsgDlg ( "Load File result is " + str(error_level), "LoadFiles", "", 1);
    if (Error_Level != 0)
    {
    OutputString = "Load File result is " + str(Error_Level);
    // make_message(‘Load File result is ‘+ str(error_level));
    MsgDialog(OutputString, TitleString);
    Error_Level = 0;
    } // end (Error_Level != 0)
    else
    {
    ReturnValue = Window_ID;
    make_message(‘Load File Successful’);
    } // end else
    return(ReturnValue);
    } // LoadFiles

    int SetRefresh() // Function to set refresh based on DOS or Windows
    {
    int TurnOffRefresh;
    TurnOffRefresh = 1;
    refresh = FALSE;
    return(TurnOffRefresh);
    } // SetRefresh

    int SetRefreshToTrue() // Function to set refresh to TRUE state
    {
    int TurnOffRefresh;
    TurnOffRefresh = 1;
    refresh = TRUE;
    return(TurnOffRefresh);
    } // SetRefresh

    int ReSetRefresh(int TurnOffRefresh, int T_Refresh) // Function to reset refresh
    {
    if (TurnOffRefresh)
    refresh = T_Refresh; // return screen updating to prior
    return(1);
    } // ReSetRefresh

    int DeleteFileType(str FileToBeDeleted) // Function to delete a specific file
    {
    int DOS_result = 0;
    DEL_FILE(FileToBeDeleted);
    DOS_result = error_level;
    if (DOS_result == 0)
    make_message(‘DeleteFileType->’+FileToBeDeleted+’ deleted’);
    else
    {
    ErrorReport(DOS_result);
    } // end else
    return(DOS_result);
    } // DeleteFileType

    void DelWindowInList(str FileToBeTested, str CapFileName) // Function to delete an MEW window in the Window list
    {
    int Loop, WindowsOpen;
    int TurnOffRefresh, T_Refresh = refresh; // save the current refresh state here

    TurnOffRefresh = SetRefresh();
    FileToBeTested = CAPS(FileToBeTested);
    CapFileName = CAPS(CapFileName);
    //MsgDlg ( "DelWindowInList-> CapFileName – "+ CapFileName+" FileToBeTested "+FileToBeTested, "File", "", 1);
    Set_Global_Int(‘WindowDeletedFromMEW’,0);
    if (CapFileName == FileToBeTested)
    {
    DELETE_WINDOW;
    Set_Global_Int(‘WindowDeletedFromMEW’,1);
    } // end if (CapFileName == FileToBeTested)
    else
    {
    WindowsOpen = Window_Count;
    for ( Loop = 1; Loop <= WindowsOpen; Loop++)
    {
    Switch_Window(Loop);
    CapFileName = CAPS(File_Name);
    //MsgDlg ( "CapFileName – "+ CapFileName+" FileToBeTested "+FileToBeTested, "File", "", 1);
    if ( CapFileName == FileToBeTested)
    {
    DELETE_WINDOW;
    break;
    } // end if ( CapFileName == FileToBeTested)
    } // end for ( Loop = 1; Loop <= WindowsOpen; Loop++)
    } // end else
    ReSetRefresh(TurnOffRefresh, T_Refresh); // return screen updating to prior
    return();
    } // DelWindowInList

    int CloseAndDeleteFile(str FileStr) // Function to close a file, then delete it
    {
    int DOS_result, FileStatus;
    str CurrentFile = File_Name;
    DelWindowInList(FileStr, CurrentFile); // in case it already is open in MEW, close the window
    // need to remove file from window before deleting!
    FileStatus = File_Exists(FileStr);
    if ( FileStatus == 1)
    {
    DOS_Result = DeleteFileType(FileStr);
    } // end if ( FileStatus == 1)
    return(DOS_result);
    } // CloseAndDeleteFile()

    int SaveTheFile() // Function to perform file saving with related checking
    {
    int ReturnStatus = 1;
    SAVE_FILE;
    make_message(‘Save File’);
    if (ERROR_LEVEL != 0)
    {
    error_level = 0;
    rm(‘meerror’);
    ReturnStatus = 0;
    } // end (ERROR_LEVEL != 0)
    return(ReturnStatus);
    } // SaveTheFile
    [/code:3so9brhq]

    Here is Test.sh
    [code:3so9brhq]
    prototype Test
    {
    str TranslateDOS(int result); // Function to return a string based on DOS result
    int ErrorReport(int DOS_result); // function to print out error information
    int MsgDialog(str InfoString, str TitleString); // Function to call MsgDlg, inserting first two parameters
    int FindWindowInList(str FileToBeTested, int DebugString); // Function to find an MEW window in the Window list
    int LoadFiles(str NewFileStr); // Function to load files based on MEW definition
    int SetRefresh(); // Function to set refresh based on DOS or Windows
    int SetRefreshToTrue(); // Function to set refresh to TRUE state
    int ReSetRefresh(int TurnOffRefresh, int T_Refresh); // Function to reset refresh
    int DeleteFileType(str FileToBeDeleted); // Function to delete a specific file
    void DelWindowInList(str FileToBeTested, str CapFileName); // Function to delete an MEW window in the Window list
    int CloseAndDeleteFile(str FileStr); // Function to close a file, then delete it
    int SaveTheFile(); // Function to perform file saving with related checking
    }
    [/code:3so9brhq]

    #9696
    Clay Martin
    Keymaster

    Hi,
    I did not see anything glaringly wrong. Is there a possibility that you are opening more that 128 windows? If so you may need to open a window with a file, do your processing and then close the window before opening the next.

    Clay

    #9699
    MewUser
    Participant

    Clay, the number of windows is usually between 1 and 15.

    This is now happening every time that I create a new session, add a file, then am unable to delete it.

    #9700
    Clay Martin
    Keymaster

    Hi,
    Are you indicating that you can’t close windows even if you don’t run your macro? When you go to close a window do you get an error message? Can you see the menu command to close the window, or is that missing?

    Try this, use the forum entry below to locate your config directory. With ME (Multi-Edit) not running, rename the following two files from that directory, meconfig.db and wcmdmap.db. Then restart ME and see if the problem persists. By renaming them, ME will place new (factory default) version of the two files in that directory. If that does not solve the problem, you can rename the two files back to restore your menu and command modifications.

    Please use the following post to locate your config directory.

    viewtopic.php?t=2013

    Thanks,
    Clay

    #9701
    MewUser
    Participant

    Hi Clay,

    I renamed Wcmdmap.db and Meconfig.db, Started MEW so that default *.db files were created, and after adding a file, I was NOT able to delete it, using the menu and CtrlF6.

    Are you indicating that you can’t close windows even if you don’t run your macro?
    Yes

    When you go to close a window do you get an error message?
    No

    Can you see the menu command to close the window, or is that missing?
    It is there

    #9702
    Clay Martin
    Keymaster

    Hi,
    Looks like the problem is not in the config files. At this point all I can recommend is a uninstall and reinstall.
    Thanks,
    Clay

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.